let obj = {
x: 10,
y: 'hello',
[Symbol('new')]: 'world'
};
const s = Symbol('new');
let obj = {
x: 10,
y: 'hello',
[s]: 'world'
};
console.log(obj[s]);
...
city: data[0].address?.city,
...
JavaScript is an important part of the web platform because it provides many features that turn the web into a powerful application platform. Making your JavaScript-powered web applications discoverable via Google Search can help you find new users and re-engage existing users as they search for the content your web app provides. While Google Search runs JavaScript with an evergreen version of Chromium, there are a few things that you can optimize.
Получается, то сравнение
'hello' == '123'
это
parseInt('hello') == parseInt('123')
так?
И [] == {} аналогично parseInt([]) == parseInt({})?
'hello' == 123
приведёт строку к числу ToNumber('hello') == 123
и получится NaN == 123
→ сравниваем два числа и получаем false
.Number
. Content-Type: application/json
можно посылать запрос как text/plain
.application/json
это опасно. constructor
. Подозреваю что вы делаете это в консоли браузера и переменную эту никогда не объявляли, поэтому JS выдаст вам свойство constructor
глобального объекта. В данном случае это будет window.constructor
который конечно же никакого отношения к вашей функции Func не имеет.constructor
имеет смысл смотреть у экземпляра объекта, а не у класса.let f = new Func();
console.log(f.constructor === Func) // true