What will be the result of the following code?

var foo = function(){
            a: 1,
            b: 2,
            c: 3
SyntaxError will be thrown because after the return there is a line break and the compiler will automatically add a semicolon there. That will result a syntax error.

This is quite tricky question!

2018 Jun 20, 10:31:41 AM

+Vitia Dychko, now it is fixed) thanks

2015 Aug 27, 11:36:10 AM

Some troubles with translation.

2015 Aug 16, 5:47:40 PM

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Зарегистрируйся сейчас
или Подпишись на будущие тесты