Data Types in Java Script
1. Primitive Data Types
One of the most fundamental characteristics of a programming language is the set of data types it supports. These are the type of values that can be represented and manipulated in a programming language.
JavaScript allows you to work with three primitive data types −
- Numbers, eg. 123, 120.50 etc.
- Strings of text e.g. "This text string" etc.
- Boolean e.g. true or false.
2. Trivial Data Types
JavaScript also defines two trivial data types-
- null
- undefined
each of which defines only a single value.
3. Composite Data Types-
JavaScript supports a composite data type.
- object- An object (that is, a member of the data type object) represents a collection of values (either primitive values, like numbers and strings, or composite values, like other objects). Objects in JavaScript have a dual nature: an object can represent an unordered collection of named values or an ordered collection of numbered values.
- Array- an ordered collection of numbered values. So Array is the part of an objects in Java Script.
Note:- Although objects and arrays are fundamentally the same data type in JavaScript, they behave quite differently.
JavaScript defines another special kind of object, known as a function . A function is an object that has executable code associated with it. A function may be invoked to perform some kind of operation. ...