Juick
Discuss
Discover
Login
archive
2 years ago
JS
Есть знатоки js? Может кто-то объяснить, почему это так работает?
console.log('foo' == ['foo'], 'foo' == ['bar'])
Recommend
Replies (4)
vt
2 years ago
@archive
, а как оно работает? false false, а в чем дело?
/1 ·
Reply
archive
2 years ago
@vt
, Я в шоке, что ['foo'].toString() будет 'foo', а не '["foo"]'
/2 in reply to
/1
·
Reply
archive
2 years ago
@vt
, true false выводит
/3 in reply to
/1
·
Reply
vt
2 years ago
@archive
, А, не так скопировал. Ну круто же.
ecma-international.org
/4 in reply to
/3
·
Reply