A higher order function is a function that takes one or more functions as arguments, or returns a function as its result.
We can say two objects are referentially equal when the pointers of the two objects are the same or when the operators are the same object instance. For example {} === {} is false because it is checking referential equality.
Example:
<script>
var a = 1;
var b = 1;
console.log(a == b); // true
console.log(a === b); // true
var c = 10;
var d = "10";
console.log(c == d); // true
console.log(c === d); // false
const name1 = {
first_name: "sarah",
};
const name2 = {
first_name: "sarah",
};
console.log(name1 == name2); // false
console.log(name1 === name2); // false
console.log(Object.is(name1, name2)); // false
console.log(Object.is(name1, name1)); // true
</script>
What are your thoughts on this post?
I’d love to hear from you! Click this link to email me—I reply to every message!
Also use the share button below if you liked this post. It makes me smile, when I see it.