Whats wrong with this code?
function test() {
(function(){
console.log('1')
})()
(function(){
console.log('2')
})()
}
test()
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re missing the semi-colons from the end of each function call…
Here is a JSFiddle of the working code if you need to test it. For example, in Chrome you can right-click > inspect element > and switch to the “Console” tab
Thanks to @pimvdb for pointing out what this actually attempts to do when you do not have the semi-colons: