Explain the difference between == and === in JavaScript.
Answer Posted / hr@tgksolutions.com
• == (Abstract Equality) compares values without considering data type (performs type coercion).
o Example: 5 == "5" → true
• === (Strict Equality) compares both value and type.
o Example: 5 === "5" → false
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the use of isNaN function?
What are Cookies in Javascript?
How long does it take to learn javascript?
How to add/remove properties to object dynamically in javascript?
What is enum size?
How do you add an element at the beginning of an array?
How to prevent modification of an object in Javascript?
Are java and javascript same?
What is missing in my code? function numberTally(numList) { var evenTotal = 0; var oddTotal = 0; for (var i = 0; i <= numList.length; i++) { if i % 2 { // i is odd oddTotal += numList[i]; // or oddTotal = oddTotal + numList[i]; } else { // i is even evenTotal + numList[i]; } } alert(oddTotal); return evenTotal; }
What is a method in javascript?
Does javascript support foreach loop?
What is closure?
How we can get the value of an element using javascript?
How many types of variables are there in javascript?
How to get an element by class in javascript ?