- Symbol (new in Edition 6)
- Error (Built-in)
You can convert a string to an integer using the built-in parseInt() function.
In old browsers strings beginning with a “0” are assumed to be octal (radix 8), but this hasn’t been the case since 2013.
A special value called NaN (short for “Not Number”) is returned:
Any value can be converted to a boolean according to the following rules:
- false, 0, empty strings (“”), NaN, null, and undefined all become false.
- All other values become true.
Examples of Boolean() function as follows:
Boolean operations such as && (logical and), || (logical or), and ! (logical not) are supported.
So, we don’t frequently need to use it.
🖥 Recommended VPS Service
VULTR provides high performance cloud compute environment for you.
Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour).
In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!