r/javaScriptStudyGroup • • Sep 27 '17

Why is !=== not valid JS?

I have always seen !== and never !===.

2 Upvotes

6 comments sorted by

2

u/kyle_Ziulkowski Sep 27 '17

!=== doesnt mean anything

1

u/[deleted] Sep 27 '17

But why? Wouldn't it mean 'Not equal in type and value'?

1

u/kyle_Ziulkowski Sep 27 '17

Theres 2 ways to express not equal. != or !==

Slight variations as to how each comparison is performed behind the scenes.

1

u/weezy_krush Sep 27 '17

because it wasn't written into the spec would be my guess

0

u/[deleted] Sep 30 '17

[deleted]

3

u/[deleted] Oct 04 '17

!= compares the values. !== Compares the values and data type

1

u/dhegde001 Oct 28 '17 edited Oct 29 '17

Sorry for being an ass here, but a more accurate way of putting what happens is that != checks for value non equality with coercion allowed and !== checks for value non equality without coercion being allowed.