What is !!?
Type your question above this line.
Course: https://www.educative.io/collection/5679346740101120/5720605454237696
Lesson: https://www.educative.io/collection/page/5679346740101120/5720605454237696/5739578472267776
What is !!?
Type your question above this line.
Course: https://www.educative.io/collection/5679346740101120/5720605454237696
Lesson: https://www.educative.io/collection/page/5679346740101120/5720605454237696/5739578472267776
Hello @masha
!!
in JavaScript is an operator that is used to cast variables to boolean. For instance, 1
will cast to true
if we do !!1
. Similarly, 0
will cast to false
if we do !!0
.
Hope this helps!
Thanks.
Than what is !1 or !0?
!
reverses the truth value. !1
would evaluate to 0
and vice versa for !0
.