Computer Science, asked by lennyej6762, 1 year ago

What is the 'new' keyword in JavaScript?

Answers

Answered by sharvaridhawad
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 cyrusbishop
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