1.

What Will Be The Output Of The Code Below? var Z = 1, Y = Z = Typeof Y; console.log(y);

Answer»

The output WOULD be undefined. ACCORDING to the associativity RULE, operators with the same precedence are processed based on the associativity property of the operator. Here, the associativity of the assignment operator is Right to LEFT, so TYPEOF y will evaluate first , which is undefined. It will be assigned to z, and then y would be assigned the value of z and then z would be assigned the value 1.

The output would be undefined. According to the associativity rule, operators with the same precedence are processed based on the associativity property of the operator. Here, the associativity of the assignment operator is Right to Left, so typeof y will evaluate first , which is undefined. It will be assigned to z, and then y would be assigned the value of z and then z would be assigned the value 1.



Discussion

No Comment Found