What is the 'new' keyword in JavaScript?
Answers
Answered by
0
The new keyword is used in javascript to create a object from a constructor function. The new keyword has to be placed before the constructor function call and will do the following things: Creates a new object.
Answered by
0
Answer:
The new operator is used to create a Class object or an Array. It allocates memory and returns the reference of memory at run time.
Explanation:
When objects are created of a class type, the instant variables occupy separate memory spaces corresponding to each object. Hence, variables a, b and c are allotted to each object separately but contains different values.
Similar questions
Environmental Sciences,
7 months ago
Computer Science,
7 months ago
Hindi,
7 months ago
Computer Science,
1 year ago
History,
1 year ago
History,
1 year ago