DEV Community

Sagar Gnawali
Sagar Gnawali

Posted on

Day 1 -> 40 days of code.

shallow comparison operator.
When it comes to string a(sc)b returns true and in case of array and object it returns false.
ie for primitive data types a(sc)b true and for complex data types a(sc)b false.

Let's check
var a="data";
var b="data";
var a=c;
console.log(a===b,a===c);//true,true

var a=[1,2,3];
var b=[1,2,3];
var a=c;
console.log(a===b,a===c);//false,true

javascript #code

Top comments (0)