Primitives are called that basically because they are represented as is in the underlying C++ code, or bytecode.
But in JS, everything is an object. undefined, for example is a property that lives in the window object of a browser. Naturally, in JS primitives are wrapped in their [forgot the ECMA-naming-convention] object. But as long as you assign a primitive to a variable or use () or return it (thus wrapping it in an object), it becomes an object on its own automatically because of the prototypical nature of the language.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Primitives are called that basically because they are represented as is in the underlying C++ code, or bytecode.
But in JS, everything is an object.
undefined
, for example is a property that lives in the window object of a browser. Naturally, in JS primitives are wrapped in their [forgot the ECMA-naming-convention] object. But as long as you assign a primitive to a variable or use () or return it (thus wrapping it in an object), it becomes an object on its own automatically because of the prototypical nature of the language.