+ 43

for those who are still confused in =,==,=== operaters

=(equal) is used for assigning a value to variable,  == operator will compare for equality after doing any necessary type conversions. The === operator will not do the conversion, so if two values are not the same type === will simply return false. It's this case where === will be faster, and may return a different result than ==. In all other cases performance will be the same. Example: 20 == '20' , will return TRUE 20 === '20' , will return FALSE

20th Jun 2016, 1:30 PM
Shakti Singh
Shakti Singh - avatar
19 ответов
+ 36
= for assigning a value to a variable like var age = 20; == for comparing two variables whether they are of equal type === for comparing two variables whether they are strictly equal sample code: var age1= 20; //age1 is just a variable not object var age2 = new number(20); /* age2 is an object here as we used number constructor function using the keyword new */ alert(age1 == age2); // true alert(age1 === age2); //false hope this helps you
23rd Jun 2016, 9:32 AM
Sumanth Reddy
Sumanth Reddy - avatar
+ 15
example for == var a = "42"; // string var b = 42; // number if(a == b) // true in case of == the comparison is made between two values after the necessary conversion of values of either side from one data type to another. like in the above example ist a is converted into NUMBER from STRING data type and then the comparison occurs and result is true. but if we have used ===. operator then the result would have been false because this operator won't let convert the values of either side their data type. if(a===b) // false
2nd Jul 2016, 6:18 PM
Ankit Ak Singh Kharb
Ankit Ak Singh Kharb - avatar
+ 8
== used to compare values, === used to compare both value and datatype
26th Jun 2016, 6:55 AM
giga Lapanashvili
giga Lapanashvili - avatar
+ 4
Honestly, I'd still be confused after reading this.
21st Jun 2016, 1:49 AM
ZinC
ZinC - avatar
+ 4
= is use to denote values like x =5 , now x will have value 5
21st Jun 2016, 3:59 PM
Shakti Singh
Shakti Singh - avatar
+ 2
== is usually use to compare value on certain conditions like in IF and FOR loop ...
21st Jun 2016, 4:00 PM
Shakti Singh
Shakti Singh - avatar
+ 2
What is java
26th Jan 2017, 12:36 AM
Muhammad sani
Muhammad sani  - avatar
+ 2
I understood the movie inception but , not this
29th May 2018, 11:23 AM
New_user28
New_user28 - avatar
+ 1
@Codde Ded because age2 is an object whereas age1 is a number
28th Jan 2017, 2:57 PM
Sumanth Reddy
Sumanth Reddy - avatar
+ 1
`=` Assign value. `==` Check if the same value. `===` Check if the same value and data type.
18th Feb 2017, 12:16 PM
Glenn Field
Glenn Field - avatar
0
= for assigning a value to a variable like var age = 20; == for comparing two variables whether they are of equal type === for comparing two variables whether they are strictly equal sample code: var age1= 20; //age1 is just a variable not object var age2 = new number(20); /* age2 is an object here as we used number constructor function using the keyword new */ alert(age1 == age2); // true alert(age1 === age2); //false
12th Aug 2016, 4:41 PM
Mohamed Ahmed
Mohamed Ahmed - avatar
0
Define please the terms object and type?
15th Apr 2017, 2:39 PM
Esther Chambers
0
me
24th Oct 2017, 10:37 AM
Jay Muller
- 1
@Kandula Samantha, but why is this so? I would assume age1 and age2 are of the same value types: integers. why would '===' then evaluate to 'false'? what is the javascript engine comparing here: values against values, or values against value types?
19th Nov 2016, 10:26 AM
Codde Ded
Codde Ded - avatar
- 1
still confused
27th Dec 2016, 8:07 AM
raman kumar
raman kumar - avatar
- 1
like if u r studying in 2017
8th Feb 2017, 7:34 AM
Mukesh Sharma
Mukesh Sharma - avatar
- 1
8=="8" ,but 8==="8" no
9th Feb 2017, 9:16 AM
Enek
Enek - avatar
- 1
good
11th Feb 2017, 7:57 AM
tg.yusoff family
tg.yusoff family - avatar
- 2
me too
21st Jun 2016, 3:51 PM
Sandeep G Khode
Sandeep G Khode - avatar