Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (13.1k points)
Can anyone help me why the new keyword is used in JavaScript since it is not an object-oriented programming language?

1 Answer

0 votes
by (26.7k points)

Basically, it will help you to create a new object. Also, it will make this variable point to the newly created object. It helps to execute the constructor function whenever this keyword is mentioned. 

I hope this will help.

Want to become a Java Expert? Join Java Training now!!

Want to know more about Java? Watch this video on Java Training | Java Course for Beginners:

Related questions

0 votes
1 answer
0 votes
1 answer
asked Feb 16, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
asked Jan 25, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...