working on console.log and alert with javascript