What is proto in javascript

Поділитися
Вставка
  • Опубліковано 18 лис 2024

КОМЕНТАРІ • 82

  • @HiteshCodeLab
    @HiteshCodeLab  4 роки тому +5

    Full course is FREE and will be available here
    courses.learncodeonline.in/learn/Complete-Javascript-course

  • @kuldipthakkar1508
    @kuldipthakkar1508 4 роки тому +9

    Sir your teaching method is amazing 🤩 waiting for regular expression in javascript

  • @Iammrunkown
    @Iammrunkown 3 роки тому +1

    you make very high-quality content in this series

  • @mazeenmuhammed
    @mazeenmuhammed 3 роки тому +3

    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.

  • @dualwan
    @dualwan 4 роки тому

    someday i will buy some of your tutorials if i land a job... thank you so much...

  • @jacobmathew2984
    @jacobmathew2984 4 роки тому +2

    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

  • @tanzimibthesam5861
    @tanzimibthesam5861 4 роки тому

    Awesome sir. Next prototypal inheritance hopefully

  • @milanprajapati1133
    @milanprajapati1133 4 роки тому

    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.

    • @HiteshCodeLab
      @HiteshCodeLab  4 роки тому +6

      If it’s difficult to watch 1 video a day, imagine efforts behind creating videos

    • @milanprajapati1133
      @milanprajapati1133 4 роки тому

      @@HiteshCodeLab that's also true sir ,your efforts are grate sir

  • @cyrusgracias4556
    @cyrusgracias4556 4 роки тому +1

    I think this was very basic intro to prototype

  • @peeyushjain1879
    @peeyushjain1879 3 роки тому +2

    @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?

    • @rite2rohit
      @rite2rohit 2 роки тому +1

      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

  • @VikasChauhan1809
    @VikasChauhan1809 3 роки тому +1

    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()...

  • @faisalmomin362
    @faisalmomin362 3 роки тому

    In an interview the question was asked to me that
    what is the difference between proto & prototype?

  • @chandansen8207
    @chandansen8207 3 роки тому

    You are great.. Very much cool tutorial

  • @stephin4474
    @stephin4474 4 роки тому +1

    How's the weather Hitesh sir
    Are you all right

  • @dakshamdev
    @dakshamdev 4 роки тому +2

    Always Amazing Content!

  • @musarratjahan5689
    @musarratjahan5689 4 роки тому

    Please sir tell me that
    is laptop with ryzen 5 4600h processor good for programming
    Please 🙏🏻🙂 reply❤️❤️❤️❤️

  • @tushargarg3
    @tushargarg3 Рік тому

    sir , after using prototype when i used the function compiler shows firstname="undefined"

  • @darkalpha6530
    @darkalpha6530 3 роки тому +1

    Excellent Work!

  • @nadeemahmed7622
    @nadeemahmed7622 4 роки тому +5

    I think you uploaded this video twice.

  • @abdremo
    @abdremo 3 роки тому

    prototype in javascript is like extension functions in kotlin:)

  • @lalitkumarmehta1721
    @lalitkumarmehta1721 4 роки тому

    thanks for this wonderful explanation

  • @besrabasant
    @besrabasant 4 роки тому

    Please make a video on "hoisting".

    • @aerozemuqeem
      @aerozemuqeem 3 роки тому

      he already made a video there is a video called code hoisting in this playlist.

  • @kkkkkabir
    @kkkkkabir 4 роки тому +1

    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?

    • @khaftabuddinahmed1634
      @khaftabuddinahmed1634 4 роки тому +5

      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...

    • @kkkkkabir
      @kkkkkabir 4 роки тому

      @@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!

    • @abhishekbhandari5306
      @abhishekbhandari5306 2 роки тому

      @@khaftabuddinahmed1634 wow man i hope that i reach on your level of understanding javascript.

  • @anushkaagarwal8686
    @anushkaagarwal8686 2 роки тому +1

    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?

    • @abinjohn3642
      @abinjohn3642 2 роки тому

      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.

    • @anushkaagarwal8686
      @anushkaagarwal8686 2 роки тому

      @@abinjohn3642 Thanks ✌️

  • @twinklegoyal2239
    @twinklegoyal2239 4 роки тому

    Sir , how can i clear network tab in developer tool programatically in javascript or how can i clear browser cache ??

  • @talibahemad8632
    @talibahemad8632 4 роки тому +1

    Sir , please upload your Udemy React.js projects on UA-cam .

  • @tanmaythaker2905
    @tanmaythaker2905 3 роки тому

    Sir doesn't this violate OOPS concept of abstraction?

  • @rbk.technology4747
    @rbk.technology4747 4 роки тому

    We have u as a guru. But from where or how did u learn all these my frnd
    Just reveal

  • @hill-ar-ious
    @hill-ar-ious 3 роки тому

    Hey, I want to know instead of making function using "function" keyword, can't we use arrow functions to make function here?

    • @hindihits9260
      @hindihits9260 3 роки тому

      arrow functions cannot be used in constructor functions, refer to mdn

  • @jericovalino4976
    @jericovalino4976 4 роки тому +1

    Thank you!

  • @rajnishkumarsingh4315
    @rajnishkumarsingh4315 4 роки тому

    I don't know why this is not working in my system?can you tell me .

  • @hiteshupreti4250
    @hiteshupreti4250 3 роки тому

    But if you change to this:
    User.prototype.getFirstName = () => {
    console.log(`Your firstname is : ${this.firstName}`);
    };
    it is not working, why??

    • @bozhidartonev2853
      @bozhidartonev2853 Рік тому

      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

  • @Ravi-oh8xz
    @Ravi-oh8xz 2 роки тому

    Loved the content❤️❤️

  • @AdityaSharan811
    @AdityaSharan811 4 роки тому

    So instead of User.prototype ..we can use object_name.prototype..right?

    • @vijaynavale3919
      @vijaynavale3919 4 роки тому +1

      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.

  • @rajnishkumarsingh4315
    @rajnishkumarsingh4315 4 роки тому

    I use getElementsByClassName also .please tell us.

  • @gurjantsingh9882
    @gurjantsingh9882 2 роки тому

    life saver video

  • @avanthaditya8596
    @avanthaditya8596 4 роки тому

    Sir, but when I do a console log on the object, I don't see the new getter function.

    • @vijaynavale3919
      @vijaynavale3919 4 роки тому

      Just go even more further the last/final proto will give you setter and getter functions

  • @jaydattr9765
    @jaydattr9765 2 роки тому

    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

  • @ankushladani496
    @ankushladani496 2 роки тому

    Thank you sir....

  • @vraj3115
    @vraj3115 4 роки тому +1

    #10minutesJS day 37!

  • @YouAndImpact
    @YouAndImpact 4 роки тому

    Great video 👍.

  • @robot67799
    @robot67799 3 роки тому

    Damn it's really fun!

  • @techiesrikanth2447
    @techiesrikanth2447 4 роки тому

    what about the new Class-based ES6 Syntax.

    • @techiesrikanth2447
      @techiesrikanth2447 4 роки тому

      @@verma__shubham What do you prefer using.

    • @vijaynavale3919
      @vijaynavale3919 4 роки тому +1

      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.

    • @techiesrikanth2447
      @techiesrikanth2447 4 роки тому

      @@vijaynavale3919 yeah.
      Thanks for the response.

  • @aayushsharma9817
    @aayushsharma9817 3 роки тому

    thanks

  • @chitej7373
    @chitej7373 4 роки тому

    I just saw you drinking beer and chilling on gaurav kapoor's zoom show...... Hilarious 😂😂

  • @tech_wizard9315
    @tech_wizard9315 4 роки тому

    When will this series be finished?

  • @mayursapkale5346
    @mayursapkale5346 4 роки тому

    Nice

  • @rudra844
    @rudra844 4 роки тому

    Thank you sir ❤😊

  • @rushlive
    @rushlive 4 роки тому

    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.

    • @ashutoshdash1999
      @ashutoshdash1999 4 роки тому

      1. Try contacting LCO team at team@learncodeonline.in.
      2. He also has his family to feed. Hope you will understand.

    • @ujjwaldeep5175
      @ujjwaldeep5175 4 роки тому

      @@ashutoshdash1999 lol

  • @sujanb3932
    @sujanb3932 4 роки тому

    😍

  • @shikhatiwari6865
    @shikhatiwari6865 3 роки тому +1

    U r very handsome

  • @Yash-fz7kw
    @Yash-fz7kw 4 роки тому

    Hello

  • @tazimrahbar7882
    @tazimrahbar7882 4 роки тому +1

    Sir sorry to say u that you made easy concept complicated and frustrating

  • @kchaitanya39
    @kchaitanya39 4 роки тому

    First comment

  • @kumarniloy1798
    @kumarniloy1798 3 роки тому

    Bad smile and bad course

  • @musarratjahan5689
    @musarratjahan5689 4 роки тому

    Please sir tell me that
    is laptop with ryzen 5 4600h processor good for programming
    Please 🙏🏻🙂 reply❤️❤️❤️❤️

  • @talibahemad8632
    @talibahemad8632 4 роки тому +1

    Sir , please upload your Udemy React.js projects on UA-cam

  • @talibahemad8632
    @talibahemad8632 4 роки тому +2

    Sir , please upload your Udemy React.js projects on UA-cam

  • @musarratjahan5689
    @musarratjahan5689 4 роки тому

    Please sir tell me that
    is laptop with ryzen 5 4600h processor good for programming
    Please 🙏🏻🙂 reply❤️❤️❤️❤️

  • @musarratjahan5689
    @musarratjahan5689 4 роки тому

    Please sir tell me that
    is laptop with ryzen 5 4600h processor good for programming
    Please 🙏🏻🙂 reply❤️❤️❤️❤️

  • @talibahemad8632
    @talibahemad8632 4 роки тому +1

    Sir , please upload your Udemy React.js projects on UA-cam

  • @musarratjahan5689
    @musarratjahan5689 4 роки тому

    Please sir tell me that
    is laptop with ryzen 5 4600h processor good for programming
    Please 🙏🏻🙂 reply❤️❤️❤️❤️