Sollicitatievraag bij Codinova

Difference between == & === ?

Antwoorden op sollicitatievragen

Anoniem

6 aug 2020

if you compare a number with a string with numeric literal, == allows that, but === doesn't allow that. ===(exact match), == (any data type return true)

Anoniem

27 jan 2021

Main difference between "==" and "===" operator is that formerly 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 the same type "===" return false, while "==" return true.

Anoniem

2 dec 2020

== matches value while === matches value amd also it's type