What is the difference between one = sign and three?


#1

var numberOne = 1
var numberTwo === 2

What's the difference between one equals sign and three equal signs? It seems to significantly affect the code.


#2

Hi the difference is ..

That th = is for storing value inside a variable like that

var name = "Wizmarco";
console.log(name);

#Output

wizmarco

the the === is for checking the equality between two variables ...it works like that

var num1 = 20;
var num2 = 10 * 2;

if (num1 === num2 ) {
   console.log(true)
}
else {
   console.log(false)
}

#Output

true

Hope that could help you understand


#3

That clears things up thank you.