Загрузка...

Can You Guess the Output? | Type Coercion in JavaScript

In JavaScript, there are 2 main ways to convert a value to a number:
• Using Number() method
• Adding “+” in front of the value
The second “+” in front of the “a” string does the same job here. It tries to convert that string to a number, but as it is not a valid number, we get NaN (Not a Number).

#javascript #coding #developer #snackjs

Видео Can You Guess the Output? | Type Coercion in JavaScript канала SnackJS
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять