What is the difference between == and === in Java script?

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

Experienced Full Stack Developer and Instructor.

== Compares values after type conversion (if necessary). If the two values are of different types, JavaScript tries to convert them to a common type before comparison. === Compares both value and type without type conversion. If the values are of different types, it immediately returns false. ...
read more
== Compares values after type conversion (if necessary). If the two values are of different types, JavaScript tries to convert them to a common type before comparison. === Compares both value and type without type conversion. If the values are of different types, it immediately returns false. Use === whenever possible to avoid unexpected type coercion issues. == can lead to unexpected results due to implicit conversions. read less
Comments

Online Mathematics tutor with 8 years experience(Online Classes for 10th to 12th)

== Compares values after type conversion (if necessary). If the two values are of different types, JavaScript tries to convert them to a common type before comparison. === Compares both value and type without type conversion. If the values are of different types, it immediately returns false. Use ===...
read more
== Compares values after type conversion (if necessary). If the two values are of different types, JavaScript tries to convert them to a common type before comparison. === Compares both value and type without type conversion. If the values are of different types, it immediately returns false. Use === whenever possible to avoid unexpected type coercion issues. == can lead to unexpected results due to implicit conversions. read less
Comments

Related Questions

What is reflection and what is its use in Java?
Its generally meant for redefining the definition of objected oriented features in more depth to intensify its object oriented design.
Rahul
0 0
7
I know HTML, CSS, and a bit of JavaScript. What should I learn next?
HTML,CSS and Javascript are Tools which are used for Front-End Web Development. The next step is to learn the following: 1)Learn Javascript Frameworks like node.js,react.js,angular.js etc. 2)Learn Back-End...
Inch By
Why we are using this keyword in Java?
to access current object
Kiran
0 0
9
Why Operator Overloading in not allowed in JAVA?
Java does not support operator overloading by programmers. This is not the same as stating that Java does not need operator overloading. Operator overloading is syntactic sugar to express an operation...
Ashish
Please suggest some books to self-learn Java at home?
For self learning the best book is Core Java written by Gary Cornell and Kay Horstmann. This book comes in 2 volumes and both are important to learn the subject from the ground up to the advanced level.
Sharmistha
1 0
6

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

JAVA OOPs Concepts (Object-Oriented Programming System)
JAVA OOPs Concepts (Object-Oriented Programming System) It is primarily having below crucial points. Without below essential points, we will never be able to achieve OOPs in java, PHP, C#, etc. Now let...

Java : Compile-time Versus Runtime optimization
While designing and development, one should think in terms of compile-time and run-time.It helps in understanding language basics in a better way.Let's understand this with a question below : What...
S

Java Overview
Java platform overview Java platform components The Java platform consists of the following components. The Java language Like any programming language, the Java language has its own structure, syntax...
A

Akshay Shende

0 0
0

History Of Java
Java history is interesting to know. The history of java starts from Green Team. Java team members (also known as Green Team), initiated a revolutionary task to develop a language for digital devices such...

Class and Objects in Java
Class is a template or a blueprint which is used to describe an object. On other hand Object is a reference of a class which follows all the stuff written inside the class. How about taking the whole tour in the following video

Recommended Articles

In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...

Read full article >

Before we start on the importance of learning JavaScript, let’s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...

Read full article >

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

Read full article >

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you