Operations that return NaN

suggest change

Mathematical operations on values other than numbers return NaN.

"a" + 1
"b" * 3
"cde" - "e"
[1, 2, 3] * 2

An exception: Single-number arrays.

[2] * [3]  // Returns 6

Also, remember that the + operator concatenates strings.

"a" + "b"  // Returns "ab"

Dividing zero by zero returns NaN.

0 / 0         // NaN

Note: In mathematics generally (unlike in JavaScript programming), dividing by zero is not possible.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Built-in constants:
* null
* NaN
* Operations that return NaN

Table Of Contents
3 Built-in constants
11 Arrays
12 Objects
14 Classes
16 Map
17 Set
24 Loops
27 Date
29 Scope
30 AJAX
35 Cookies
41 JSON
44 Fetch
45 Modules
46 Screen
64 Console
68 Symbols
73 Modals
76 Events
86 Proxy
89 WeakMap
90 WeakSet
102 Tilde