Q. What is the value of x?
Code:
let x = '5'; x = +x;
β
Correct Answer: (B)
5
Explanation: Unary plus converts the string to a number.
let x = '5'; x = +x;
Explanation: Unary plus converts the string to a number.