Junior — Middle
Can you list the data types in JavaScript that are considered primitive types?
sobes.tech AI
Answer from AI
In JavaScript, primitive types are considered to be:
string— a string, for example, "hello"number— a number, for example, 42 or 3.14bigint— integers of arbitrary length, for example, 9007199254740991nboolean— a logical type:trueorfalseundefined— the value of a variable that has not been initializednull— a special value representing "no value"symbol— a unique and immutable identifier
Primitives are stored directly in the stack and are passed by value, unlike objects, which are passed by reference.