When does 'true' equal 'false' in JavaScript?

preview_player
Показать описание

The ! operator in JavaScript converts an object to a boolean and than flips it from true to false or from false to true. Operations involving this operator can get confusing, in this case the strings equate because they are comparing length rather than value after being coerced into booleans and flipped.
Рекомендации по теме
Комментарии
Автор

I have a question why use the ! To flip false and true if it also makes it do something else in the end you said ! Also had another way of working

ChristopherMeneses-vioz
welcome to shbcf.ru