JavaScript Equality in 90 Seconds #JavaScriptJanuary

preview_player
Показать описание
Watch the entire #JavaScriptJanuary series from the beginning!

In JavaScript there are many data types. There are strings, numbers, boolean, null, and undefined. It’s important to understand these types before comparing equality.

There are two ways to compare, or check for equality. We can use the double ==, or triple ===.

Double == checks for abstract equality, which means that it actually tries to convert the type using type coercion.

Triple === checks for strict equality, so the data types must match.

In general it is always best to use strict equality testing with the triple ===. This way you will not run into any false positive issues in your code. As a best practice, if you do need to check equality on different data types, do the conversion yourself first then check for equality.

I'll be releasing a new video every day in January! Stay tuned..
_____________________________________

📚 Learn to CODE in just a FEW months here:
_____________________________________

🛠️ Tools I use:

_____________________________________

💖 Show support!
_____________________________________

Watch Next:
_____________________________________

Connect With Me:
_____________________________________

** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.

#JavaScriptJanuary #31Days31Videos #codeSTACKr
Рекомендации по теме
Комментарии
Автор

Thanks for all of the support! Stay tuned for a new video every day in January!!

Watch the entire #JavaScriptJanuary series from the beginning!

📚 My Favorite Web Design Books 📚
Web Design with HTML, CSS, JavaScript and jQuery Set by Jon Duckett (paid link)

codeSTACKr
Автор

A very perfect channel and videos, love it love it

Programming-Fun-With-Hima
Автор

Really good work. Nice and simple explanation.

sandip_bettereveryday
Автор

I didn't understand why:
console.log ("Testing Equality" === new string("Testing Equality")) //FALSE?
Because here both side are strings (data type matches).
And with first code (==) you established that "Testing Equality" == "Testing Equality"

rajuethfin
Автор

Hi codestacks, which software do you use for video editing and creation?

TheIndianDev
Автор

USE right IDE and thats it! There is a TON of useful helpers to solve those kind of errors.

qAntBcn