What will be the result of the following code?

console.log(new Number(1) === 1);
Explanation
In JavaScript any number is an instance of class Number. But if you declare a new object of class Number it may be equal by value to another number but not identical (because they are both completely different objects of class Number). Example:

var a = 1;
var b = new Number(1);
a == b // true;
a === b // false

Следи за CodeGalaxy

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

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