wlnirvana
wlnirvana

Reputation: 2047

Is it possible to define new data types in JavaScript?

MDN says there are nine data types in latest JS spec. I wondering if these are the only nine data types that the spec allows programmers to use.

Just to clarify, I think programmer-defined functions/constructors internally using prototypical inheritance are still Objects, so do not qualify as new data types.

Upvotes: 2

Views: 85

Answers (1)

VLAZ
VLAZ

Reputation: 29004

There is no facility that allows defining custom core data types in JavaScript. You can only use them and objects to construct what you want.

Upvotes: 1

Related Questions