+ 1

So if === is the best choice to practice, is !== also a better choice than != to avoid future problems in the script?

6th Aug 2016, 12:59 PM
Ar Ciela
Ar Ciela - avatar
6 Réponses
0
!== When you want to check value and type.
9th Aug 2016, 12:17 PM
Morgan Hayes
Morgan Hayes - avatar
0
nothing is good or bad. use as per your convenience and requirement.
16th Aug 2016, 8:37 AM
Nasar Siddiqui
Nasar Siddiqui - avatar
0
No it's not like that.It differs where and how you want to use it.When you know that variables are of same type use!= and if you don't know the types use !==
19th Aug 2016, 6:50 PM
Rohit Doshi
Rohit Doshi - avatar
0
think of the first character (either = or !) as saying is or is not == "is" equal to != "is not" equal to === "is" exactly equal to !== "is not" exactly equal to I'm not sure if that's the rationale but it helps me
20th Aug 2016, 3:18 PM
James
0
heres an example var JavaScript = true; if(JavaScript == false) { alert("Start!"); } if(JavaScript != false) // or == true { alert("cool!"); }
27th Oct 2016, 5:31 PM
TheBestCoderIntheworld
- 3
====================== lol no jkm
13th Aug 2016, 6:40 PM
TheBestCoderIntheworld