O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Determining If an Object Is Equal To or Less Than Another

var x=5; var y="5"; var resultA = x==y; //Evaluates to true var result = x===y; //Evaluates to false

JavaScript uses the standard ==, !=, >, <, >=, <= operators to compare two objects. It also includes the === and !== operators that are type sensitive. For example, 1=="1" evaluates to true, whereas 1==="1" does not because the first is a numerical type and the second is a string type.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required