Object Oriented JavaScript Tutorial #5 - Class Constructors

Поделиться
HTML-код
  • Опубликовано: 12 май 2018
  • 🐱‍💻 Course Links:
    - VS Code editor - code.visualstudio.com/
    - GitHub repository (course files) - github.com/iamshaunjp/object-...
    - JavaScript for Beginners - • JavaScript Tutorial Fo...
    🤑 Donate @ www.paypal.me/thenetninja
    🎓Find me on Udemy @ www.udemy.com/user/47fd83f6-5...
    👾 Video thumbnail artwork by PixelSwish @ / @designable

Комментарии • 175

  • @paudelamarianaoancea3761
    @paudelamarianaoancea3761 4 года назад +103

    finally somebody that knows to explain.

  • @raymondmichael4987
    @raymondmichael4987 6 лет назад +50

    Now when I feel like I need a basic knowledge of something, I first browse all the series found on Ninja Channel, better explanation as always; keep the good work

  • @anthonymclean1918
    @anthonymclean1918 3 года назад +1

    Netninja is so great. Every time I get stuck at some point in a long course elsewhere, I come to this channel to see individual topics explained much more clearly. Thank you :D

  • @chewa21
    @chewa21 3 года назад +3

    Clear, concise and beginner friendly.
    Finally someone that knows how to teach to people who are new to code!
    It can be so frustrating trying to find digestible lessons on YT!

  • @dwighthayles1226
    @dwighthayles1226 Год назад +6

    I kind of grasped this concept before. However, this explanation along with practice helped me to consolidate this idea. I'll be coming to this channel more often. Thanks for the help!

    • @NetNinja
      @NetNinja  Год назад +1

      That's great to hear Dwight, thanks for your support!

  • @alirasheedmd
    @alirasheedmd 3 года назад +1

    For one year almost I was struggling with classes avoided using it in the projects but today I can say I got it! Seriously this is the best tutorial I saw on classes. Loved it!

  • @mk17173n
    @mk17173n 2 года назад +2

    Man i struggled with explanation of constructor function and the "this" keyword and you explained it so well. Earned a sub.

  • @Mikemillering1
    @Mikemillering1 5 лет назад +100

    Is this really easy to understand or are you just really good at explaining it? Either way, I don't really care because it makes sense! Great Video.

    • @BADLEMONART
      @BADLEMONART 2 года назад +1

      i think somehow other videos have a way of making this seem 10x harder... and he makes this seem 10x easier 🤩

    • @breawen
      @breawen Год назад +1

      i always see these kind of comments everywhere and I thought that most people are lying but this really did make it more understandable. in fact, in every oop videos i've watched, this is the only one that i saved on my playlist

  • @bikepackingeurope2085
    @bikepackingeurope2085 3 года назад +3

    Have been struggling with this, getters and setters and you have truly just made it so simple. Thank you!

  • @safintheship
    @safintheship 3 года назад +8

    watched like 10 videos on constructors each more than 10mins long, then I come across this video. thank you.

  • @asken5139
    @asken5139 2 года назад +1

    I really really like your way of explaining things. You take nothing for granted when you explain the concepts, which is really helpful. I've been doing another course,, which I actually like, but you explain things, so I get it immediately! You have a new fan:-)

  • @abbegherab1863
    @abbegherab1863 2 года назад +1

    Omg you deserve a medal on how to explain code in such a way that even a none programmer can understand. Bravo, keep up the good work!

  • @byleexs1991
    @byleexs1991 9 месяцев назад

    I've struggled to understand the concept in other programming languages but the way you've explained the subject by first showing how to write standalone objects and seconly how to create them dynamically via classes is that missing gap I've had for a long time. Thanks a whole lot! You're incredible!

  • @PhoenixToluwa
    @PhoenixToluwa Год назад +5

    As a school teacher I AM IMPRESSED! you taught well my friend

  • @user-if6un4dx8m
    @user-if6un4dx8m Год назад +1

    An amazing teacher who has a superb way of explaining things! so much better than other tutorials! Thank you so much for the material you provide!

  • @marcomaher7803
    @marcomaher7803 4 года назад +1

    Been searching for an explanation for constructors for too long but here you are!! thanks a lot

  • @Weykent
    @Weykent Год назад +1

    All I can say is thank you. My friend lent me access to a course worth hundreds of dollars and your videos are way clearer and to the point. Amazing 👏

    • @NetNinja
      @NetNinja  Год назад +1

      Wow, thanks for the kind words Weykent :) means a lot!

  • @vaylx2253
    @vaylx2253 2 года назад +1

    Easily the best explanation for constructors I've seen so far.

  • @TheCarlFoutley
    @TheCarlFoutley Год назад

    It one of the best description of classes and constructors I've ever heard. You're rock man! Thank you.

  • @chrismaxwell8347
    @chrismaxwell8347 2 года назад +1

    I've done exercises similar to this one, but this is the first time I actually understand what and more importantly why we do this. Bravo sir 👏

  • @kevinparker2314
    @kevinparker2314 Год назад +2

    I have watched so many tutorials and im taking classes on Coursera. Nobody has come close to making this make sense for me the way that you have. By far the BEST explanation ive ever heard Thank You! I will be subscribing.

    • @NetNinja
      @NetNinja  Год назад +1

      Wow, thanks for the kind words Kevin :) much appreciated and welcome aboard!

  • @iloveyourodman7023
    @iloveyourodman7023 6 месяцев назад

    I love how you explained this man, it was so dumbed down and easily understood. I understand constructors better than ever now

    • @NetNinja
      @NetNinja  6 месяцев назад

      That's awesome to know :) thanks for watching

  • @sayeemurrahman3065
    @sayeemurrahman3065 3 года назад +1

    Thanks for making 'classes' much easier for me, I love the way you explain.

  • @naveedalirehmani4135
    @naveedalirehmani4135 3 года назад +2

    thank you very much these tutorials are the best absolutely easy to understand and the example you use to teach are very easy and relevant

  • @SahraClayton
    @SahraClayton 4 года назад

    Hi, I have to say I have just been accepted into Lambda School for Dec/Jan, having you to watch as my goto study material is just amazing.
    The way you explain everything in depth and complete detail is absolutely brilliant for someone like me who is a complete novice to coding/web dev, you give me confidence that I can come to your videos and if I didn't understand the concept before watching, I will after watching.
    Thank you @The Net Ninja

    • @NetNinja
      @NetNinja  4 года назад

      Awesome, thank you and congrats! :)

  • @Cho1279624
    @Cho1279624 6 лет назад +15

    Wow! The 'class' is used in that way. I always write the codes in like "function User(email, name){ this.email = email; this.name = name}". Maybe there are some reasons why they grabbed the 'class' into Javascript. I expect you, the Net Ninja, to explain well as always! I appreciate your teaching all the time!

    • @tiaan_va
      @tiaan_va 3 года назад +4

      Classes were never a thing in the past within JS. What you just described is creating a constructor function, that was the old way to create these type of objects, but when it came down to the prototype and inheritance the required code just looked horrible and difficult to read, thus with a newer version of JS classes were introduced to replace the old classic constructor functions. Both do the same thing, the code is just much easier to manage later down the line with classes.

  • @dennyashitey
    @dennyashitey 11 месяцев назад

    You are really good at explaining for real. I have been struggling with this for almost a week. Thank you so much

    • @NetNinja
      @NetNinja  11 месяцев назад

      Awesome, glad it helped :)

  • @Soap_js
    @Soap_js 3 года назад +1

    best programming tutorials channel fast and understandable!

  • @remoteworld2333
    @remoteworld2333 3 года назад

    Brilliantly explained. Straight to the point.

  • @inagreenleaf
    @inagreenleaf 3 года назад

    Absolutely fantastic tutorials, wished I'd come across this years ago when I started off. Anyway, not to be pedantic, but that 'new' key word actually does four things - the first three as you mentioned including the fourth which is returning the object instance it created.

  • @nasiruddin2638
    @nasiruddin2638 6 лет назад +2

    Love this series. Waiting for the next part.

  • @user-kt1gd4st4p
    @user-kt1gd4st4p 11 месяцев назад

    By far the most useful video on the subject I have found. Truly able to explain it so that a beginner like myself can understand and digest the concepts. Thank you.

    • @NetNinja
      @NetNinja  11 месяцев назад

      Glad it was helpful! :)

  • @englishtogether6506
    @englishtogether6506 3 года назад

    Thanks a lot for your thorough explanation, at last, could find a video where everything was clear. Once again thanks for your efforts.

  • @vela-6
    @vela-6 3 года назад +1

    Dude. You're 1 million times better at explaining than any other person I've seen on RUclips or Udemy. I swear all other tutorials on anything web dev speak to me as if I'm a robot. I am not a robot, thank you for teaching humans as humans.

    • @NetNinja
      @NetNinja  3 года назад +1

      Thank you, glad you like :)

    • @robotosailr2129
      @robotosailr2129 3 года назад

      same here

    • @tiaan_va
      @tiaan_va 3 года назад

      you should really watch the stuff from 'Dev Ed' then. Both on youtube and his actual courses. Makes it easy to understand and it's funny at the same time.

  • @dividedbyzero0
    @dividedbyzero0 2 года назад +1

    Flawless Tutorial. You explained everything so well!
    Thank you so much 😀

    • @NetNinja
      @NetNinja  2 года назад +1

      Glad it was helpful! :)

  • @ilamaaranramakrishnan5915
    @ilamaaranramakrishnan5915 3 года назад

    Thanks, your explanation is so simple and on point. I understand better now.

  • @TheMarioProductionz
    @TheMarioProductionz 5 лет назад +4

    Cleanest explanation so far, thank you very much!

  • @AdyB2008
    @AdyB2008 2 года назад

    Brilliantly explained. Thank you!

  • @mohammedsami6371
    @mohammedsami6371 2 года назад

    my gratitude for this video right here is so *astronomical*

  • @gazorbpazorbian
    @gazorbpazorbian 6 лет назад

    awesome video, keep em coming!, also I hope you also explain managing databases with OOP

  • @moinshaikh177
    @moinshaikh177 3 года назад

    Something worth watching Thnx for the Great Lesson ✌️ !

  • @sandrarodgers3071
    @sandrarodgers3071 5 лет назад +1

    This was extremely helpful. Thank you!

  • @daniellaerachannel
    @daniellaerachannel 6 лет назад +1

    always nice these refreshing video on JS! thanks

  • @cameronp3157
    @cameronp3157 3 года назад

    Thank you for the explanation! 🙌🏻 Good video

  • @hannahjoynson8937
    @hannahjoynson8937 2 года назад

    Absolute legend great way of explaining

  • @tajahouse4678
    @tajahouse4678 4 года назад +1

    Awesome job explaining this!

  • @ubarjaktarev
    @ubarjaktarev Год назад

    Best explanation available online. Thank you so much!

    • @NetNinja
      @NetNinja  Год назад

      You're welcome! :) hope it was helpful

  • @michaelbiba8448
    @michaelbiba8448 2 года назад

    This was super helpful! thank you!

  • @marynakhomenko1369
    @marynakhomenko1369 3 года назад

    Thanks! It’s really helpful! 🙏

  • @akhileshpm2174
    @akhileshpm2174 3 года назад

    Clearly understandable and minimalistic video

  • @alibaba888
    @alibaba888 3 года назад

    Godlike explanation. Thanks a million

  • @exosmexos915
    @exosmexos915 4 года назад

    Thank you man ! I now understand constructors ! Thumbs up to u !

  • @LotfiORouis
    @LotfiORouis 4 года назад

    Wonderful pedagogy! Thank you
    I subscribe!

  • @user-wn7et1ft9j
    @user-wn7et1ft9j 3 года назад

    THIS HELPED SO MUCH! thanks

  • @justdewmina
    @justdewmina 2 года назад

    WOW! Putting across very nicely...!

    • @NetNinja
      @NetNinja  2 года назад

      Thank you! Cheers!

  • @teteu.do.xequemat
    @teteu.do.xequemat 3 года назад

    Brave! That's why you have 700k subscripts! Keep Growing! Thanks

  • @JS-zm5se
    @JS-zm5se 3 года назад

    Simply genius explanation

  • @allin6074
    @allin6074 4 года назад

    great description thx sir keep up the great work

  • @SunilKumar-fh6jk
    @SunilKumar-fh6jk 6 лет назад

    Love you bro, you are truly a ninja! Love

  • @zoltancaputo9562
    @zoltancaputo9562 Год назад

    AWESOME , you make it simple... this.teacher = 'true teacher' Iol tks a lot for alll knowledge shared!

  • @tawsif-karim
    @tawsif-karim 6 лет назад

    great explanation...waiting for more...

  • @hananfadah
    @hananfadah 7 месяцев назад

    This was very helpful! Thanks a lot!

    • @NetNinja
      @NetNinja  7 месяцев назад

      Glad it was helpful! :)

  • @relkovic10
    @relkovic10 3 года назад

    Great explanation!

  • @djhonz45
    @djhonz45 2 года назад

    Wow, totally get it now!!!!

  • @ethancms
    @ethancms 2 года назад

    very solid explanation thank you

  • @ahmadalkordee5879
    @ahmadalkordee5879 3 года назад

    OMG ,,,, this video is the best among 10 oop videos I already saw ,,,,,,, thanks bro

  • @Er1cAI
    @Er1cAI Год назад

    Beautiful explanation! Thank you

    • @NetNinja
      @NetNinja  Год назад

      You're very welcome! :)

  • @batumanav
    @batumanav 3 года назад

    It just saved my life

  • @leweed3049
    @leweed3049 Год назад

    Thank you this helped alot

  • @niket4884
    @niket4884 4 года назад

    Woooooo.... Your explanation was AMAZING... Thank You...💝💝💝💝💝

    • @NetNinja
      @NetNinja  4 года назад +1

      You're welcome 😊

  • @DevlogBill
    @DevlogBill 2 года назад

    Appreciate your videos

  • @ya_boi_second
    @ya_boi_second 3 года назад

    I love you, ma dude!

  • @filip23128
    @filip23128 2 года назад

    Thank you very much!

  • @jeminision
    @jeminision 3 года назад

    Helpful thanks 👍

  • @tfnsansu1727
    @tfnsansu1727 10 месяцев назад

    💯🔥godninja

  • @josesuch4962
    @josesuch4962 3 года назад +1

    Nice!!!!

  • @alvinacosta2312
    @alvinacosta2312 4 года назад

    You are so amazing. So clear and concise explanations. I have one confusion right now though, I have learned from older updates of JS about constructor functions when creating new objects, so how are classes different from construct functions and when should I use classes and when should I use just plain constructor functions? Thanks man keep it up!

    • @anshsahni2864
      @anshsahni2864 4 года назад +1

      Don't use constructor functions now as classes are there.

  • @bigunhettiarachchi853
    @bigunhettiarachchi853 2 года назад

    Short and sweet
    😗

  • @00el04
    @00el04 4 года назад +1

    you're my favourite!

  • @abirpaul9027
    @abirpaul9027 3 года назад

    Man made it easy

  • @rihanulkarim3997
    @rihanulkarim3997 5 лет назад

    Tnx a lot man. U just saved my ass. Subbed

  • @ericklopezrulz
    @ericklopezrulz Год назад

    this is what a ninja means

  • @bhuvneshsinghkushwah3015
    @bhuvneshsinghkushwah3015 3 года назад

    love it

  • @dukgame4116
    @dukgame4116 6 лет назад +2

    Back With Visual Studio Code

  • @olafma71
    @olafma71 2 года назад

    thank you ver much for the very wel explained lessons. Great jon. A question on the var you use ? i did understand ( unless i am wrong ) that the old var was in more recent versions of JS replaced by the let and const because of ' scope ' reasons an the difference between var and let there . Is there a reason you use var here ? Would this also work with let ?

  • @ashleysaleem-west5485
    @ashleysaleem-west5485 5 лет назад +2

    What are the benefits using the new class syntax over simply using a constructor object on its own?

    • @tiaan_va
      @tiaan_va 3 года назад

      It makes the code when coming to inheritance between constructors (and other stuff) muuuch easier to read (and remember).

  • @chloecui2774
    @chloecui2774 2 года назад

    #The_Net_Ninja is the best teacher

  • @Rawxpphey
    @Rawxpphey Год назад

    good explanation

  • @willadams6217
    @willadams6217 6 лет назад

    What are your thoughts on choosing composition over inheritance?

  • @davideugene7911
    @davideugene7911 6 лет назад +1

    Merci :)

  • @vrudantnaiker2729
    @vrudantnaiker2729 3 года назад

    This man explained something actually no, he explained all I need to know. he needs like a 2m sub for the precise, accurate explanations he does. #ThisManIsALegend my teacher couldn't explain this...
    nothing more to say alas I am at peace...

  • @aznninjawarrior123
    @aznninjawarrior123 3 года назад

    what does putting the "var" in front of the new objects do?

  • @soundtown10
    @soundtown10 6 месяцев назад

    the "new" keyword let you create these {objects}. class is just syntactical sugar: try to instantiate a normal "function declaration" by using the "new" keyword and it will return the same value as long as you use "this" in declaring its properties(this.property = 'somevalue'). any normal function RETURNS "this:{prop1: value1, prop2: value2,...}" by DEFAULT as long as we use the "new" key word when instantiating. a CONSTRUCTOR inside a class does the same thing regarding this feature. the difference between a "class" and a "function declaration" is its naming convention as to where normal functions use "camelCase" but in class we use "PascalCase". in the early days the old Javascript engine inside our BROWSERS use functions similar to classes(today). this naming convention was made to avoid CONFUSION bet. a normal function vs a function being instantiated(new) with "this:{}" inside of it. normal functions does not RETURN "this" by default, only when instantiated using "new". Hope it helps.

  • @mh5854
    @mh5854 4 года назад

    thanks

  • @vishaltorgal3372
    @vishaltorgal3372 Год назад

    Is it proper to say to pass parameters to class we use constructors ?

  • @jvigel2101
    @jvigel2101 3 года назад +1

    noticed you were still replying to comments so I just wanna say great tutorial, but also how do you get the notifications for caps lock? it seems pretty cool ngl

  • @damiansabadsag2530
    @damiansabadsag2530 10 месяцев назад

    Can someone please explain why wouldn't we use functions for this?

  • @Zunree1869
    @Zunree1869 Год назад

    How would i get user input by doing this.

  • @asaduzzaman5356
    @asaduzzaman5356 6 лет назад +6

    carry on bro go on

  • @asaduzzaman5356
    @asaduzzaman5356 6 лет назад

    please upload the next video as soon as possible