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


Please Help Members By Posting Answers For Below Questions

What is the difference between window.onload and ondocumentready?

687


How to create an object using javascript?

718


How to delete an array entry using javascript?

623


How can you declare a class in javascript?

768


What is dom in javascript?

721


What is decodeuri() function?

699


Are Typescript and Javascript the same?

734


What is variable typing?

725


How can an HTMLCollection be traversed?

709


What is the difference between .call() and .apply()?

776


How do you change the style/class on any element?

736


How to make elements invisible?

882


what is the difference between window & document in javascript?

665


How to add buttons in javascript?

614


What is a prompt box in javascript?

692