Sign in Go Pro

Beginning JavaScript for React Native

Comparing Values

 
Autoplay

Up next

Previous

About

JavaScript values can be compared using the operators: ==, ===, !=, !==, <, <=, >, >=

The biggest point of confusion is the difference between double equals (==) and triple equals (===). In general, you should always use tripled equals (===) when possible, because it compares both type and value.

You can compare things of like primitive type, or of unlike primitive type - though comparisons of unlike primitive types may not always be what you expect.

Summary of Content:

  • List of value comparators
  • Difference between double equals (==) and triple equals (===)
  • Comparing strings and numbers

Resources:

https://www.w3schools.com/js/js_comparisons.asp

Instructor

Links

Comments

There are no comments on this lesson, start the conversation below ...

>
You need to go PRO to post comments.

Lessons in Beginning JavaScript for React Native