Advertisement
728x90
Let's take console statement with unary operator as given below,
javascript
1console.log(+"Hello"); // NaNThe output of the above console log statement returns NaN. Because the element is prefixed by the unary operator and the JavaScript interpreter will try to convert that element into a number type. Since the conversion fails, the value of the statement results in NaN value.
Advertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 7
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
350of476