Difference between “==” and “===” operators

 Both are comparison operators. The difference between both the operators is that,“==” is used to compare values whereas, “ === “ is used to compare both value and types.


Example:

var x = 2;
var y = "2";
(x == y)  // Returns true since the value of both x and y is the same

(x === y) // Returns false since the typeof x is "number" and typeof y is "string"

No comments:

Post a Comment

The differences between Angular SSR (Server-Side Rendering) and Angular SSG (Static Site Generation) can be summarized as follows

  1.  When HTML is Generated SSR : HTML is dynamically generated  on each request  by the server. The server processes the request, fetches ...

Best for you