- Sep 30, 2018
- admin
- 0
Node.js Basics:
Node.js uses JavaScript for programming. Thus, most of its syntax and basic features are more so similar as JavaScript.
Node.js Data Types:
Node.js is a loosely typed language, which means that it automatically corrects the data type of the variable, depending on its value. There are mainly two types of data types used in Node.js:
- Primitive Data Types:
String:
A sequence of characters is termed as string.
Number:
All the numeric values are included in this data type.
Boolean:
It can take only two values, either 0 or 1, i.e, either TRUE or FALSE.
- Undefined:
The undefined values are grouped under this data type.
Null:
NO value or NULL is represented by this data type.
Non – Primitive Data Types:
RegExp:
RegExp is a non-primitive type of data that is used to represent regular expression.
Object:
An Object is an entity that represents an instance to access its members.
- Buffer:
Additional data type in Node.js which is used to store binary data.
Global Objects:
Node.js global objects can be used directly without including them. Some of the Node.js global objects are listed below:
- __dirname
- __filename
- Console
- Process
- Buffer
- setImmediate()
- setInterval()
- setTimeout()
- clearImmediate()
- clearInterval()
- clearTimeout()