One operand is a non-primitive

Explanation: When either operand is a non-primitive, the + operator will convert it into a primitive, and then act as it usually would with that new primitive representation. Here's an example:

[123] + 123; // => "123123"

In this case, JavaScript will convert [123] into its primitive value by using the return value of [123].toString() (that is, "123"). Since the primitive representation of an array is its String representation, the + operator will operate as if we were simply doing "123" + 123, which, as we know, evaluates to "123123".

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.253.223