JavaScript · Junior · Question 1 of 75
How many data types does JavaScript have according to the specification?
- ✓Correct answer: 8: seven primitives and
object - 26:
number,string,boolean,null,undefined,object - 33: primitives, objects and functions as a separate type
Explanation
Primitives: number, bigint, string, boolean, null, undefined, symbol. Everything else is object, including arrays, functions and dates. Functions are objects, even though typeof returns 'function' for them.