Understanding the new operator in JavaScript | Part 2 | Yomesh Gupta | Devtools Tech

preview_player
Показать описание
The new operator lets developers create an instance of a user-defined object type or of one of the built-in object types that has a constructor function. In this two part video series we will look how new operator works, what all different use-cases can arise, and some good to know around this operator.

0:00 - Introduction
0:08 - Explicit Primitive Return
2:31 - Constructor Mode Test
5:28 - Constructor's Prototype

We hope you learn something from our videos and they help you in some way. If they do then kindly give it a thumbs up and subscribe to our channel for more amazing videos.

Support Devtools Tech via --

**************************************************************
Devtools Tech is a YouTube channel which was started as a collaborative effort among like-minded engineers to provide high quality programming tutorials for free. We firmly believe in knowledge sharing and easy access to quality content for everyone. Hence, this channel is an effort to give back to the community and a step towards our belief -- "We rise by lifting others".

Team Members:
Yomesh Gupta

Saloni Kathuria

Puneet Ahuja

#JavaScript #NewOperator #Frontend #Nodejs #yomeshgupta **************************************************************
Рекомендации по теме
Комментарии
Автор

This video topic is quit basic but most of the experience person also don't know. Thanks for taking efforts on these kind of video. Expecting more such videos. Very informative and clean explanation. Thanks.

TusharBorawake
Автор

Loved it, especially how you explained everything from the ground up, making it both beginner and intermediate friendly

munishthakur
Автор

TIL that returning a primitive value from a constructor function returns the implicit this. Thanks for the explanation.
Just a follow up, if we'd want to make sure that the constructor function is invoked using the "new" keyword, we could also use `if(!(this instanceof ConstructorFunction)){throw new Error("Call me with new keyword")}` right? I was wondering what's the difference between using `new.target` and `instanceof`?

prajwalkulkarni