Hi one suggestion. When you said we can restrict accessing the variables outside and it's not for this video what if we want to know about it. Yes you can say it's advanced. So my suggestion would be you can name all the videos with a integer in the beginning and wherever you think you can add advanced tutorial, you can have another playlist called advanced and name the videos as 1.a description, 28.a description. So intermediate and advanced users can make use of it.
hey, hitesh can you plz tell more about the new keyword b'cause i came upon this " new function " and u haven't told about it in the new keyword session
sir as i start javascript from last two day ....and i reach here in just two days with practice and all credit goes two you but it is difficult two watch only one video par day because i have to start your ReactJs course so it is beneficial for all of us if you upload complete course in one day.
@hitesh, I tried adding the property using prototype via arrow function then it is giving undefined but working fine with normal function declaration. can you tell why?
Arrow functions can never be used as constructor functions. Hence, they can never be invoked with the new keyword. As such, a prototype property does not exist for an arrow function
is there any real use case where we can use this concept? I mean real-world example or any project example because if we are adding it here we can also define the method inside the User as we did for getCourseCount()...
I have a question. I tried printing my name using the arrow function in the prototype but I got "undefined", but my name is printing perfectly when I execute using a normal function. Why so?
This is a great question. First of all the main difference with normal function and arrow function is normal function can have his own "this" value whereas arrow function does not have his own "this" value he get it from it's parent's "this" value. Try to colsole.log(this) on both the cases you will see the arrow function is representing window object and normal function will showing current object. You cannot change the value of "this" in arrow function but in normal function you do with bind keyword. i.e: User.prototype.name = function () { console.log(this); console.log(this.firstName); }.bind({ firstName: "Aftab", lastName: "Ahmed" }); the bind property will overwrite your previous firstName and lastName that you will be provide with new keyword. Hope this helps...
Sir, I tried using arrow function when writing a function through prototype. But it showed undefined in that situation. But when I wrote the description using the functional call it gave the right output. What can be the reason behind that?
That's probably because arrow functions don't have a *this* value of their own. When we're using regular function style for the methods, *this* will point to the object calling the method. This doesn't work when we use arrow functions for methods.
anonymous function does not provide context, and so it points to the window/global object, use function(){...} instead if you want to acces this. or bind the THIS of the object that you want to refer
No you first have to fed the property or method into the constructor which is in this case user, then only user instances can have access of these methods with the help of prototype property, yes prototype is simply a property were you store all you methods and properties.
just like we added/injected mathod into the object without touching that object, can anyone explain how to add more properties in object just like we added functional object there. please
Yes but understanding these will give you more exposure about inheritance, what's going on underhood will give you a better look at these ES6 classes syntactical-sugar.
bro, I have two problems. Can you please solve it? I am Bangladeshi. So I cannot sign up on your website. It requires OTP of an Indian number. So what can I do now to access your courses? Then another problem is that I want to access your 'Android P' course. But due to COVID 19, my family is in a financial crisis. Hope you will understand. Can you please give the half contents of that course free ? If you can, I will be grateful to you.
Full course is FREE and will be available here
courses.learncodeonline.in/learn/Complete-Javascript-course
Sir your teaching method is amazing 🤩 waiting for regular expression in javascript
you make very high-quality content in this series
Hi one suggestion. When you said we can restrict accessing the variables outside and it's not for this video what if we want to know about it. Yes you can say it's advanced. So my suggestion would be you can name all the videos with a integer in the beginning and wherever you think you can add advanced tutorial, you can have another playlist called advanced and name the videos as 1.a description, 28.a description. So intermediate and advanced users can make use of it.
someday i will buy some of your tutorials if i land a job... thank you so much...
hey, hitesh can you plz tell more about the new keyword b'cause i came upon this " new function " and u haven't told about it in the new keyword session
Awesome sir. Next prototypal inheritance hopefully
sir as i start javascript from last two day ....and i reach here in just two days with practice and all credit goes two you but it is difficult two watch only one video par day because i have to start your ReactJs course so it is beneficial for all of us if you upload complete course in one day.
If it’s difficult to watch 1 video a day, imagine efforts behind creating videos
@@HiteshCodeLab that's also true sir ,your efforts are grate sir
I think this was very basic intro to prototype
@hitesh, I tried adding the property using prototype via arrow function then it is giving undefined but working fine with normal function declaration. can you tell why?
Arrow functions can never be used as constructor functions. Hence, they can never be invoked with the new keyword. As such, a prototype property does not exist for an arrow function
is there any real use case where we can use this concept? I mean real-world example or any project example because if we are adding it here we can also define the method inside the User as we did for getCourseCount()...
In an interview the question was asked to me that
what is the difference between proto & prototype?
You are great.. Very much cool tutorial
How's the weather Hitesh sir
Are you all right
Always Amazing Content!
Please sir tell me that
is laptop with ryzen 5 4600h processor good for programming
Please 🙏🏻🙂 reply❤️❤️❤️❤️
sir , after using prototype when i used the function compiler shows firstname="undefined"
Excellent Work!
I think you uploaded this video twice.
prototype in javascript is like extension functions in kotlin:)
thanks for this wonderful explanation
Please make a video on "hoisting".
he already made a video there is a video called code hoisting in this playlist.
I have a question. I tried printing my name using the arrow function in the prototype but I got "undefined", but my name is printing perfectly when I execute using a normal function. Why so?
This is a great question. First of all the main difference with normal function and arrow function is normal function can have his own "this" value whereas arrow function does not have his own "this" value he get it from it's parent's "this" value. Try to colsole.log(this) on both the cases you will see the arrow function is representing window object and normal function will showing current object. You cannot change the value of "this" in arrow function but in normal function you do with bind keyword. i.e:
User.prototype.name = function () {
console.log(this);
console.log(this.firstName);
}.bind({ firstName: "Aftab", lastName: "Ahmed" });
the bind property will overwrite your previous firstName and lastName that you will be provide with new keyword.
Hope this helps...
@@khaftabuddinahmed1634 Oh now I get it! Thanks a lot bro! Really you cleared my doubt which was I stuck in for a long time! Thanks!
@@khaftabuddinahmed1634 wow man i hope that i reach on your level of understanding javascript.
Sir, I tried using arrow function when writing a function through prototype. But it showed undefined in that situation. But when I wrote the description using the functional call it gave the right output. What can be the reason behind that?
That's probably because arrow functions don't have a *this* value of their own.
When we're using regular function style for the methods, *this* will point to the object calling the method. This doesn't work when we use arrow functions for methods.
@@abinjohn3642 Thanks ✌️
Sir , how can i clear network tab in developer tool programatically in javascript or how can i clear browser cache ??
Sir , please upload your Udemy React.js projects on UA-cam .
Sir doesn't this violate OOPS concept of abstraction?
We have u as a guru. But from where or how did u learn all these my frnd
Just reveal
Hey, I want to know instead of making function using "function" keyword, can't we use arrow functions to make function here?
arrow functions cannot be used in constructor functions, refer to mdn
Thank you!
I don't know why this is not working in my system?can you tell me .
But if you change to this:
User.prototype.getFirstName = () => {
console.log(`Your firstname is : ${this.firstName}`);
};
it is not working, why??
anonymous function does not provide context, and so it points to the window/global object, use function(){...} instead if you want to acces this. or bind the THIS of the object that you want to refer
Loved the content❤️❤️
Thanks
So instead of User.prototype ..we can use object_name.prototype..right?
No you first have to fed the property or method into the constructor which is in this case user, then only user instances can have access of these methods with the help of prototype property, yes prototype is simply a property were you store all you methods and properties.
I use getElementsByClassName also .please tell us.
life saver video
Sir, but when I do a console log on the object, I don't see the new getter function.
Just go even more further the last/final proto will give you setter and getter functions
just like we added/injected mathod into the object without touching that object, can anyone explain how to add more properties in object just like we added functional object there. please
Thank you sir....
#10minutesJS day 37!
Great video 👍.
Damn it's really fun!
what about the new Class-based ES6 Syntax.
@@verma__shubham What do you prefer using.
Yes but understanding these will give you more exposure about inheritance, what's going on underhood will give you a better look at these ES6 classes syntactical-sugar.
@@vijaynavale3919 yeah.
Thanks for the response.
thanks
I just saw you drinking beer and chilling on gaurav kapoor's zoom show...... Hilarious 😂😂
When will this series be finished?
Nice
Thank you sir ❤😊
bro, I have two problems. Can you please solve it?
I am Bangladeshi. So I cannot sign up on your website. It requires OTP of an Indian number. So what can I do now to access your courses?
Then another problem is that I want to access your 'Android P' course. But due to COVID 19, my family is in a financial crisis. Hope you will understand.
Can you please give the half contents of that course free ? If you can, I will be grateful to you.
1. Try contacting LCO team at team@learncodeonline.in.
2. He also has his family to feed. Hope you will understand.
@@ashutoshdash1999 lol
😍
U r very handsome
Hello
Sir sorry to say u that you made easy concept complicated and frustrating
First comment
Bad smile and bad course
Please sir tell me that
is laptop with ryzen 5 4600h processor good for programming
Please 🙏🏻🙂 reply❤️❤️❤️❤️
Sir , please upload your Udemy React.js projects on UA-cam
Sir , please upload your Udemy React.js projects on UA-cam
Please sir tell me that
is laptop with ryzen 5 4600h processor good for programming
Please 🙏🏻🙂 reply❤️❤️❤️❤️
Please sir tell me that
is laptop with ryzen 5 4600h processor good for programming
Please 🙏🏻🙂 reply❤️❤️❤️❤️
Sir , please upload your Udemy React.js projects on UA-cam
Please sir tell me that
is laptop with ryzen 5 4600h processor good for programming
Please 🙏🏻🙂 reply❤️❤️❤️❤️