I know in javascript "=== equal value and equal type" is controlling value and type. I have two examples in angular that I am confusing.
var o1 = { name: 'David', age: 26, skill: {} };
var o2 = angular.copy(o1);
console.log(o2);
// Output: { name: 'David', age: 26, skill: {} }
console.log(o1 === o2);
// Output: false
console.log(o1.skill === o2.skill);
// Output: false
// o2.skill is a copy of o1.skill. They don't point to the same skill object.
I have another example:
<html>
<body>
<p id="demo"></p> // output of z is "true"
<script>
var x = 5;
var y = 5;
var z = (x === y);
document.getElementById("demo").innerHTML = z;
</script>
In first example why === is returning false? "===" is looking only data type and value.
x and y are pointing different area also. But === returning true.
Thanks in advance