The Artima Developer Community
Sponsored Link

Java Buzz Forum
Difference between == vs === Operator in JavaScript while Comparing Variables - Interview Question

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
Difference between == vs === Operator in JavaScript while Comparing Variables - Interview Question Posted: Jul 27, 2013 8:16 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: Difference between == vs === Operator in JavaScript while Comparing Variables - Interview Question
Feed Title: Java67
Feed URL: http://www.java67.com/feeds/posts/default?alt=rss
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Advertisement
In one of the recent JavaScript interview for a Java web development position, one of my reader was asked this questions, What is difference between comparing variables in JavaScript using "==" and "===" operator? My reader got shocked because he was from Java background and doesn't have great exposure to JavaScript, though he was pretty much familiar with some JavaScript function, event handling and some jQuery tricks, he wasn't aware of subtle details of JavaScript. He did the right think, politely said that he is not aware of difference between == and === operator. Though It did not affected his interview performance much, he was keen to know about this as soon as he finished with his interview. He asked to me as well, and that's the reason of this post. In one word, main difference between "==" and "===" operator is that former compares variable by making type correction e.g. if you compare a number with a string with numeric literal, == allows that, but === doesn't allow that, because it not only checks the value but also type of two variable, if two variables are not of same type "===" return false, while "==" return true. We will see couple of example of both operator in this article, to understand difference between them much better.
Read more ยป

Read: Difference between == vs === Operator in JavaScript while Comparing Variables - Interview Question

Topic: Getting started with the Neo4j Java Rest Binding (Heroku deployment) Previous Topic   Next Topic Topic: 5 Coding Hacks to Reduce GC Overhead

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use