commit
8ddceabcad
1 changed files with 1 additions and 0 deletions
|
@ -107,6 +107,7 @@ if (zero) { // zero is true, because it's an object
|
|||
On the other hand, using the same functions `String/Number/Boolean` without `new` is totally same and useful thing. They convert a value to the corresponding type: to a string, a number, or a boolean (primitive).
|
||||
|
||||
For example, this is entirely valid:
|
||||
|
||||
```js
|
||||
let num = Number("123"); // convert a string to number
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue