comment not a question really... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

comment not a question really...

Just noticed on the Comparison Operator section that on the example shown below it reads. var num = 10; //num ==8 will return a false I think it should be wrote as... var num ==10; //num ==8 will return a false Anyways.. Do not want to be the "SYNTAX POLICE" but noticed this and belief this is just a Syntax error/Typo. Thoughts?

5th Dec 2019, 9:39 AM
Josh.Reese🐼💨🔥
Josh.Reese🐼💨🔥 - avatar
5 Answers
5th Dec 2019, 10:16 AM
A͢J
A͢J - avatar
+ 3
What they are saying is, first you store `10` in `num`: var num = 10; Then, if you compare that variable to `8`, the result will be `false`: if(num == 8) alert("10 is equal to 8 lmao"); else alert("no way jose"); Try it in the code playground: https://code.sololearn.com/WMQu57YqdkFk/?ref=app The first operator `=` is assignment, you are telling the variable what value it is. The second `==` is comparison, you are asking the variable whether it is equal to a value.
5th Dec 2019, 10:29 AM
Schindlabua
Schindlabua - avatar
+ 2
Josh.Reese🐼💨🔥 First you should know about Single equal sign (=) and double equal sign (==) then you will know that var num = 10 is correct not var num == 10
5th Dec 2019, 10:14 AM
A͢J
A͢J - avatar
+ 2
Thank You everyone for your comments, as definately was wrote RIGHT and I was definately wrong. ✅I haven’t messed with code in many years, but back out in society and trying to do RIGHT. Thank You everyone for your time and comments , as I will load a virtual bowl of dank for your Water Pipe. ✌🏻😁💨
5th Dec 2019, 10:56 AM
Josh.Reese🐼💨🔥
Josh.Reese🐼💨🔥 - avatar
+ 1
yes . definately false but think the problem should read. var num==10; instead of var num=10; 🤔
5th Dec 2019, 9:57 AM
Josh.Reese🐼💨🔥
Josh.Reese🐼💨🔥 - avatar