Object-oriented Programming in JavaScript: Made Super Simple | Mosh

Поділитися
Вставка
  • Опубліковано 1 лют 2025

КОМЕНТАРІ • 1 тис.

  • @sebbyapudo7357
    @sebbyapudo7357 3 роки тому +120

    I learnt Python, SQL and Java from your Tutorials and I'm here to learn JavaScript from you again. You not only teach how to write code and the syntax but also how to think like a proffessional software engineer. You are the best Mosh

  • @PetttCZ
    @PetttCZ 5 років тому +599

    MOSH, I'm in IT for 25+ years.. I've seen stuff :O) This is by far the best organized, tutored, and well thought through course. People should be learning from you how to do this... respect.
    Petr

    • @syedkashifhassankazmi7269
      @syedkashifhassankazmi7269 5 років тому +2

      Computer sciences vs Information technology?
      Which would you recommend?

    • @badripaudel77
      @badripaudel77 5 років тому +3

      Computer science I think is more diverse.

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

      @@syedkashifhassankazmi7269 The one which you have more passion in. But yeah as @Badri Upadhyay said, computer science is more diverse.

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

      @@syedkashifhassankazmi7269 Computer science

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

      Glad to hear that, Pett. It's my first approach to Javascript OOP (did it before with PHP) and this video makes it super clear!

  • @imtanuki4106
    @imtanuki4106 6 років тому +65

    Unlike most online code tutorials, this (series) is well-organized, clearly and simply explained and it moves along at a good clip without being overwhelming! Kudos!

  • @ArthurSilveira
    @ArthurSilveira 5 років тому +255

    I cannot believe this video is free... This is the the best javascript tutorial I have ever seen.

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

      This is video from full course on OOP JavaScript. You can visit codewithmosh.com for full course.

    • @kartikm5030
      @kartikm5030 2 роки тому +9

      No bro, watch namaste javascript

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

      👍 like Jayapa

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

      Thank you for 🌳 free session

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

      Thank you again I am 🏡 home.school government experiment

  • @akugoms7736
    @akugoms7736 6 років тому +915

    00:00 : What is OOP?
    01:46 : Four Pillars of OOP
    08:50 : Setting Up the Development Environment 11:07: Objects
    11:53 : Object Literals
    14:58 : Factories
    17:50 : Constructors
    23:27 : Constructor Property
    25:53 : Functions are Objects
    31:09 : Value vs Reference Types
    37:00 : Adding or Removing Properties
    40:54 : Enumerating Properties
    43:45 : Abstraction
    47:48 : Private Properties and Methods
    51:55 : Getters and Setters
    57:32 : Exercise
    59:42 : Solution

    • @HuaJarry
      @HuaJarry 6 років тому +3

      thanks, this index is really awesome, very conveinient. how did do that?

    • @abraaoazevedo5077
      @abraaoazevedo5077 6 років тому +10

      He did it by just watching the video and taking note of the each part and his minute.

    • @codecrayon9120
      @codecrayon9120 6 років тому +48

      @@abraaoazevedo5077 Or he just copied it from the video description.

    • @CameronChardukian
      @CameronChardukian 6 років тому +3

      @@codecrayon9120 Brilliant hahaha

    • @stickz9871
      @stickz9871 5 років тому +2

      @@codecrayon9120 Useful tho, dont be a beoch. The desc didnt have the link

  • @James-lw3gi
    @James-lw3gi Рік тому +9

    I mean, seriously, this is the next level of free learning content on UA-cam.
    So many videos out there on coding. But for me, so far, this is the best laid out course I've found.
    Kudos to Mosh!
    I'm going to deep dive on your channel so hard :)

  • @jenniferl2146
    @jenniferl2146 2 роки тому +127

    Love your videos, Mosh ❤I did struggle with tutorials. What really worked for me were Books and Mosh`s Videos.
    Edit: For those asking, I started learning with a basic book named Javascript In Less Than 50 Pages, which is very beginner friendly.
    Then I improved my skills with another one named Head First Javascript Programming.
    With those books I finally learned and wanted to share what worked for me.

  • @olganedykhalova3323
    @olganedykhalova3323 5 років тому +20

    Probably the most aesthetically pleasing on-line JS course I have ever had. :)

  • @harvindersingh9170
    @harvindersingh9170 11 місяців тому +2

    Finally, I understood what OOP is actually and why it is different from functional JS. "Thank you very much, Mosh, for providing this premium quality content for free."

  • @sheikabdullah8209
    @sheikabdullah8209 6 років тому +17

    Your teaching is amazing man., no one can beat u., I strongly suggest ur videos who want expert in JS. 100000 likes

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

    I am a Java dev with 7 years of experience. Your videos on JavaScript are the best ones so far to brush up rusty js knowledge !)

  • @kid_kulafu_1727
    @kid_kulafu_1727 6 років тому +15

    I wish all professors are like you. Please have a lot of children and teach them the way you thought us. Itll help the future generations.

    • @Wedneswere
      @Wedneswere 6 років тому +1

      Once up a time, before standardized tests, all teachers were actually teachers.

  • @devsheepboi
    @devsheepboi Рік тому +3

    As an italian, I almost drop out of my chair seeing a salad on top of that spaghetti dish at 2:40 😅
    Other then that, EVERY SINGLE WORDS on this video still actual in 2023!! Hands up to you 🎉

  • @mikejakusz1493
    @mikejakusz1493 2 роки тому +5

    The first time I watched this video, I was very confused. I'm back one month later, and I understand it this time around. If this didn't click the first time, don't give up!

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

    מוש היקר, כיוון שאף אחד לא הגיב לך כאן בעברית. רציתי שתראה את זה.
    אני מאוד מודה לך על ההנגשה וההסברה שאתה עושה. זה מאוד מוערך וכיף ביותר!
    אני לא יודע אם זה כי אני מבין מאוד את המבטא שלך בגלל השפה, אבל אתה בעיני מסביר הכי טוב ולעניין וזה מה שהופך אותך למורה טוב!

  • @sonnychiba5270
    @sonnychiba5270 6 років тому +6

    You should write a Mosh framework that allows people to easily create video tutorials with clear visuals. Your tutorials are great and easy to follow

  • @kashifumar4552
    @kashifumar4552 2 роки тому +7

    One semester of work is done in about an hour. A very very great lecture.

    • @Cozmii
      @Cozmii Місяць тому

      you talk nonsense.. you can t compare 1 semester of work with a tutorial

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

    Have been self-teaching myself code since covid-19 got rolling and i feel very lucky to have found your channel today. I've made more progress in 2 hours than the previous 2 months in terms of capacity and confidence with JavaScript

  • @aiGuyReal
    @aiGuyReal 4 роки тому +12

    This is by far the best tutorial I have ever seen in my life. It is so well organised, well-mannered and you've made JavaScript seem like a piece of cake. Truly magnificent! Keep it up.

  • @emanuelmateusinacio7873
    @emanuelmateusinacio7873 6 років тому +8

    The amount of knowledge I learned from your video is insane. You're one of the best coding tutors I've ever found on youtube. Thanks for your videos. I learned a lot just in this video alone

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

    Mosh I come from the VHDL Verilog background to understand OOP. You given here an excellent knowledge and awesome lecturing. Love your videos. Now I am more loving to learn software programs after watching your videos. It is just not the knowledge gain, but you really inspiring and made to jump into a full fledged learner on JS and C++. Simply incredible work you doing here and helping the Software community. Thank you

  • @rammaheshwari3008
    @rammaheshwari3008 6 років тому +59

    Mosh is a Gift to Planet Earth ❤

  • @munishgarg75
    @munishgarg75 4 роки тому +21

    We do have classes in JavaScript. The classes were introduced after ES5 in the JS.

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

      Can someone link a UA-cam video tutorial so I can know how to use classes?

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

      @@serpentav422 bro just search classes in JS on UA-cam , you will surely get one!!!

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

      @@serpentav422 He talks about classes at the end of his modern ES6 and Typescript videos :-)
      ua-cam.com/video/NCwa_xi0Uuc/v-deo.html or ua-cam.com/video/NjN00cM18Z4/v-deo.html

  • @ramanparashar1
    @ramanparashar1 6 років тому

    This guy just made everything look simple !
    Just started coding few months back.. I have been gulping up the React.js courses from last one month & currently doing Redux.... Many things were going over my head & I started to think that programming is difficult...until I saw this tut !
    Highly recommend this to new coding peeps !!

    • @ramanparashar1
      @ramanparashar1 6 років тому

      I'm an entrepreneur based our of Delhi, India. Currently developing a SaaS product in bootstrap mode.
      Although we have surpassed the beta phase, but on the way we have realized that relying on developers is quite risky as a business, since we as founders have non-technical background.
      Deliberate delays, misguiding & disproportionate salaries are just a few problems which we encountered on our way to launch.
      After that I decided to take things in my own hands & got one of my dev. friend to oversee all the Tech part till I am confident of taking over the Tech.
      My goal is to understand all the stuff that's happening at coding level, & eventually manage the developers we have hired. And also to get my hands on coding if the doomsday arrives.

  • @berry.like.strawberry
    @berry.like.strawberry 6 місяців тому +36

    Thank you for telling a beginner after 10 min that it is not for beginners 😂

    • @FXDOVE
      @FXDOVE Місяць тому

      Lolz 😢.

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

    loved this tutorial, I was shifting from C# to node.js finding trouble in implementing OOPs in js, this made it a cake walk for me

  • @menardmaranan
    @menardmaranan Рік тому +48

    Just an update for new viewers. The `class` syntax is now widely available in JS after ES6. It is somewhat a syntactic sugar to defining a constructor function like shown in the video.

    • @monikadangol2587
      @monikadangol2587 4 місяці тому

      Thanks. I was confused when Mosh said 'we dont have class in JS'. Your comment has helped me

  • @Denis-ge2xu
    @Denis-ge2xu 4 роки тому +1

    I almost cried for the clarity of your teaching methodology!
    Graciasss

  • @weblead7396
    @weblead7396 6 років тому +10

    thanks mosh, you are one of my best teacher. best of luck.

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

    Coming from 100Devs, I am a new subscriber. Loved how organized and easily explained everything was!

  • @kflo411
    @kflo411 4 роки тому +4

    Your awareness of your viewers' different programming contexts make this video very unique, in the JS space. Every mention of how the equivalent is done in C#/Java is much appreciated..!

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

    Great tutorial. I had a little bit of trouble with the exercise but I eventually figured it out.
    One thing I did differently was in my "duration" getter, I added an 'if' clause to check if the stopwatch was running. If it was, I set the duration to the current lapsed time at that moment, then returned 'duration'. That way you would always be able to see the duration, even if you haven't stopped the stopwatch yet.

  • @AlokTripathi
    @AlokTripathi 6 років тому +16

    great explanation Mosh, you are the simple, concise and best.

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

    Mosh is the best tutor..If you really need to understand concepts and need a good job..enroll to his courses.He is best.Thankyou Mosh

  • @daniellaerachannel
    @daniellaerachannel 6 років тому +29

    a very good explanation, keep teaching like this! thanks

  • @supentamu3073
    @supentamu3073 Рік тому +1

    Oh Goodness Gracious me What a Presentation👍👋✌ Even in premium paid courses No one teaches like this. Thank you very much GOD Bless you MOSH for your great service to the students community at large

  • @zedal1
    @zedal1 6 років тому +238

    Thumbs up if you are tired of that bespectacled Udemy advert guy who is always going: "python is where its at...Y'know...you should take this online course at Udemy....bla bla bla". He seems to follow me wherever I go on UA-cam.

    • @jidaasare7021
      @jidaasare7021 6 років тому +2

      Hahahahaaa, even after six months this advert still persists. Same here. I am just fed up.

    • @Cognitoman
      @Cognitoman 6 років тому +8

      yeah hes a son of a bitch

    • @KeepItFresh02
      @KeepItFresh02 6 років тому +1

      @@Cognitoman lol.....

    • @denniszenanywhere
      @denniszenanywhere 5 років тому

      That guy is back again, EST, 5:34 pm, April 18.

    • @aventurando4502
      @aventurando4502 5 років тому +2

      adblock

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

    Hi Mosh, first of all, I would thank you for your amazing videos. I have +3 years exp as a dev. What I like about your courses is your way of explanation. The way you teach is likely the way of the academic teaches but with a magic touch! Most instructors on UA-cam ignore the identifications like what closures, abstraction, ...etc mean? and they are so important to know especially for the interviews!

  • @pouyajabbarisani
    @pouyajabbarisani 6 років тому +23

    I would like to explain oop in #arrowFunctions as methods a little bit for dear developers in here:
    If you use factory function, then you can NOT use #this keyword in it because it refers to the window object.
    But,
    If you use constructor function, then you can use #this keyword because it refers to our own object.

  • @sharansingh4956
    @sharansingh4956 5 років тому +1

    Best vid found in js, for intermediates and experinced js devs so far. Definitely gonna buy the course 😃

  • @johnnychun2017
    @johnnychun2017 6 років тому +8

    It is one of the best tutorial with very straightforward and step to step. Unfortunately I missed your course sales. I will look forward for next time. Huge thank for this.

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

      If it’s udemy just wait like an hour for the sales again lol

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

      @@BobbyBundlez 😆😆

  •  5 років тому +1

    Mosh you give the best, cleanest, explanation on everything. Great teacher!

  • @hassanramazan6822
    @hassanramazan6822 6 років тому +6

    Really great!
    The points that I couldn't have got yet in anywhere else have got here...
    Thanks MOSH

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

      It's a very good tutorial... it's just a pity that JS is terrible for OO

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

    50:00 explanation about closure. Scope variables are recreated everytime the functuon is called and scope limited to inside of braces. Closure allows function to access parent functions members as well.

  • @dommcica
    @dommcica 6 років тому +3

    Hi Mosh! Great tutorial, it really helped me a lot to understand the basics. I will definitely continue with the rest of your videos.
    But I found the example with increase() function a bit confusing. I am not skilled enough, so maybe I am mistaken, but at 34:15 - 34:42 the same result (number = 10, not 11 as you stated in video) will return (if we add "return" of course) because of operator i++, which returns a value before increment.

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

      I'm sure you've found this out by now, but just to be clear for others, Mosh and you are both right in this regard. When you pass a variable as an input parameter to a function, its copy is being passed, not the original variable, hence any changes made inside the function will remain inside and never make out of that function.... unless you use a return statement to update the variable outside the function (as you said). To add onto this, this problem is solved by using pointers in C++, thru which you can pass the "reference" of that variable to a function and then no copy is created.

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

    Mosh was just AMAZING at explaining OOP, I have learned so much in 1h! BIG THANKSSS

  • @liadoz4369
    @liadoz4369 4 роки тому +7

    43:45 - It called Encapsulation, not Abstraction. Abstraction is something else in OOP

  • @Askbowe
    @Askbowe 5 років тому

    My implementation was with the use of a factory function ... const sw = function(){
    return {
    start: function(){ console.log('start timer')},
    stop:function(){console.log('stop timer')},
    reset:function(){console.log('reset timer')},
    duration:function(){ console.log('get duration')}
    }
    }
    let stopwatch = new sw
    stopwatch.start()
    stopwatch.stop()
    etc...
    I learnt a whole lot ... thanks for the video

  • @migueltoledopy
    @migueltoledopy 4 роки тому +4

    You lost me when you said on 10:44 :: "This is no for begginers, it's for intermediate level developers, so you need at least three months of experience programming on javascript"
    So I'll practice and see you in 3 months sir, or less, who knows :D great video btw

  • @malakhaitham-p3g
    @malakhaitham-p3g 2 місяці тому

    Mosh, you teach programming as a journey ... I enjoy listening to your courses.

  • @raanaalizadeh
    @raanaalizadeh 6 років тому +6

    I'm in love with your tutorials Mosh , Thank you

  • @Retrofire-47
    @Retrofire-47 8 місяців тому

    "Inheritance is a means of *reducing* redundant code."
    clever take on the concept. This one will stick with me

  • @juandig
    @juandig 5 років тому +8

    Finally a tutorial on how to write OOP in JS ;-;
    Thanks a lot, it makes sense and I don't know why I couldn't get to this by myself. It's very simple :))
    The most interesting thing for me was using the "in" operator to check whether an key is in an object or not though, I've always used "Object.keys(obj).indexOf("key") > -1" 😅

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

      seems like you might know what I need. I want to become a front-end web dev, the course I'm currently doing doesn't provide me with the basics of javascript, should I watch this video?

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

      @@shreedharsharma4745 honestly mate, I can't learn with courses and stuff. I learned programming by trying out different stuff. It started with keybinders with Autohotkey (simple scripting language) and I just advanced as I tried out new stuff. Get yourself some random web page from the internet, maybe something from dribble and try to create your own copy of that website locally. Think abt stuff you would do differently. Check out some portfolios of devs and look at their projects. The best way to learn programming in my opinion is by trying.
      This video helped me because I already knew how object oriented programming works with other languages and I never really thought abt it in JavaScript. This video gave me a better understanding of how functions and objects etc work in JavaScript and helped me organizing my codebase in JavaScript projects :)

  • @hingsing1
    @hingsing1 7 місяців тому

    really solid video. I think it's worth mentioning that before beginning the exercise at the end.. as a hint, people can take advantage of the Date() method and instantiate using new Date() (you can perform subtraction between date instances to get the time elapsed). For me, I had to do a quick google search and there were so many answers online but I figured this was the simplest so find the time elapsed lol.

  • @hasiburrahman9392
    @hasiburrahman9392 6 років тому +8

    Your tutorial is Awesome. Thanks Mosh

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

    This is the best explanation of OOP in javaScript ever.

  • @DjSeymur
    @DjSeymur 4 роки тому +14

    You taught so much in the introduction, I thought the video ended at 8:48. lol

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

    I am a .Net developer and interested on learning JS. always had some problem with understanding the JS. I found this course really helpful as it also compares the C# and JS . thanks a lot

  • @k23raj2
    @k23raj2 5 років тому +22

    Fullstack developer=== traversy media + MOSH .
    Thanks to both channels which made many learners to programmers.
    Pls like if u agree.

  • @fayaz.net93
    @fayaz.net93 5 років тому

    You are super awesome. I have been programming for 12 years, never saw such an amazing explanation. 1 mio likes. And just bought annual subscription :)

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

    Mosh your teaching style makes pdf's obsolete. You are great 😇

  • @ShwetaKalariya
    @ShwetaKalariya 6 років тому +6

    Hey Hi Mosh, I must say your tutorials super awesome..

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

    Wow, i am watching this now, and so far this is the best explanation of OOP i have ever encountered. Thank you!

  • @AamirKhan-ci5gt
    @AamirKhan-ci5gt 6 років тому +165

    JavaScript is the language i hate the most because of its syntax.
    Now only because of MOSH's tutorials.......................
    I am full-stack JavaScript developer and love the JavaScript the most.

    • @Tux0xFF
      @Tux0xFF 6 років тому +3

      Same for me, i now like js es6 because of his tutorials, makes sense, it finally clicks.

    • @nitishsingh535
      @nitishsingh535 6 років тому +1

      Plz tell me....I don't know what a JavaScript do or why it uses so much syntax...what do they do with a web page...

    • @iLoveTurtlesHaha
      @iLoveTurtlesHaha 6 років тому +6

      @@nitishsingh535 You need a course that caters to beginners. I hate to spam Mosh's channel but if he doesn't have a beginners course for web dev check out Andrei N's "The complete Web Developer" on Udemy. If you can find a beginners course from Mosh, I highly recommend Mosh's over anyone else because his teaching style is better. He makes you understand concepts on a deeper level - something you'll be thankful for if you are trying to find work in the industry.

    • @skjahir1091
      @skjahir1091 6 років тому +1

      thanks mosh for such informative tutorial

    • @DevOtionSynthax
      @DevOtionSynthax 5 років тому +1

      @@nitishsingh535 Try this: www.udemy.com/javascript-basics-for-beginners/ Mosh's begginers course, I used it and learned a lot!

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

    Best OOP tutorial on UA-cam

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

    This is a great video! I've recommended it to many of my classmates. Just a small suggestion, maybe in the example, instead of 'circle, radius, location...', you can use something easier to understand like 'user's info', 'apples', 'shopping list' etc. to make the learning process even more smoother. I know that circle is easy to understand already XD but every time I see radius and stuff like computeOptimumLocation, it takes me 1 second to react >

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

    I hated the name crash course but then I found this channel. Great tutorials.

  • @LorenIpsum123
    @LorenIpsum123 6 років тому +4

    Thank you! I finally start to feel like I understand objects!

  • @TheEndlessFever
    @TheEndlessFever 6 років тому

    There must be a Love button under UA-cam videos.
    Because I have fallen in love with the way you teach programming.
    #Programming_Made_Easy (Y)
    Thanks!

  • @prassanthkc
    @prassanthkc 6 років тому +3

    Thanks Mosh for this great wonderful tutorial. Keep going.

  • @georgesmith3022
    @georgesmith3022 6 років тому +50

    Mosh I come from an OOP background and I was really confused with objects in Javascript. Fortunately, this tutorial cleared up a lot of things. However, I am wondering if these are worth knowing since ES6 defines proper objects via classes and not by functions as shown here. Will this be covered in your course? thanks

    • @sanal4492
      @sanal4492 2 роки тому +6

      Well that's not true. The classes added in ES6 are just syntactical sugar behind which things work just as before. Javascript has always been a prototypical based Object Oriented Programming language.

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

      @@sanal4492 so there is a class notation (syntactically) but in background, it works as a constructor function.

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

    Your explanations and presentation are second to none

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

    Great tutorial Mosh, my only concern is I felt during the factory vs constructor function part, it got very muddled up and confusing. But apart from that, it was very comprehensive.

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

      I agree. I think a simpler example would help. I'm still learning, and that part tripped me up.

  • @PINGPONGROCKSBRAH
    @PINGPONGROCKSBRAH 5 років тому +1

    Thank you for making the font in your tutorials BIG so that I can actually read it when I have two windows open on my tiny laptop screen.

  • @natnaelalemayehu9112
    @natnaelalemayehu9112 4 роки тому +43

    I just love the background music

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

      It's a programming class in a jazz bar. 👍

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

      it's classy (pun.js)

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

    🤯I've been around OOP for 20 years and this is the first time someone explained it

  • @Sencifouy
    @Sencifouy 6 років тому +4

    I think I understand OOP JS a little better now. I'll still need to get back at apply and call.
    Thanks a lot !

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

    I'm kinda late to the party but this is the best video I've seen on OOP in JS in a long time! Thank you

  • @SohaibShaheen
    @SohaibShaheen Рік тому +2

    Heads up for those coming to this tutorial in 2023, setting variables like shown in example:
    let duration, startTime, endTime = 0;
    will actually lead duration to be undefined and when you try to add seconds to it in stop function, it will produce NaN.
    Correct way is: let duration = 0, startTime = 0, endTime = 0;

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

    so far the best video on OOPs java-script. I really appreciate your hard-work and efforts.

  • @vandeljasonstrypper6734
    @vandeljasonstrypper6734 4 роки тому +35

    38:24 Ok now I know why strongly-type devs say "Javascript is a cancer"

    • @BLABLABLABLABLABL298
      @BLABLABLABLABLABL298 4 роки тому +3

      That's why we have TypeScript

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

      I guess because there are a lot of functions and thing that you can do wrong but the good side is that JavaScript make amazing stuff

    • @EGG-Academy
      @EGG-Academy 3 роки тому

      @@Victory_Accomplished kull

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

    I am 2 months into JavaScript and I learn some very easy forms of functions including arrow functions for JavaScript. But these functions are a little more complicated, but I guess I need to practice these functions a lot to get good at these types of functions. I am up to this timeline of the video (22:09) and I think so far (not sure?), that constructor functions are a little more easier to understand in comparison to factory function. Using "this." versus the return key I find so far to be easier at this moment, it makes more sense. But I guess as functions become more complicated maybe I will change my mind, thanks Mosh for the education.

  • @AureliaCasts
    @AureliaCasts 6 років тому +10

    Great tutorial on OOP, thanks!

  • @krisek98
    @krisek98 5 років тому +1

    God damn big thanks for that course, thats what I needed to be introduced into JavaScript after 4 languages I know already. Again, BIG THANKS!

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

    I finally understand getters and setters. You are fantastic, thank you so much 💜

  • @soultouchingsongs
    @soultouchingsongs 6 років тому +6

    Excellent.. Thank you so much. 👍

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

    I wish I had computer+internet when i studied computer engineering because i find it damn easy now when i watch your videos.I literally found these concepts herculean those days. Anyway, I appreciate you from the bottom of my heart.

  • @pierolp1202
    @pierolp1202 5 років тому +3

    what theme are you using? btw, your videos are awesome!

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

    18:51
    I love how "this" keyword still makes sense when you explained it (The keyword still makes sense for this comment too)

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

    20:30 - Why does this return Circle and not another? I thought the new operator pointed this to the newly created object.

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

    49:25 : Best closure explanation for me so far. Thank you Mosh!

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

    Clean, Simple, High Knowledge, Perfect

  • @geekynerd24
    @geekynerd24 4 роки тому +8

    Me:- I dont know coding and i am not intrested
    Mosh:- I am going to make him programmer

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

    i really respect the fact that u mentioned this course is not for begginers

  • @trappedcat3615
    @trappedcat3615 6 років тому +11

    I prefer factory functions over new objects. Less maintanence.

    • @ARQAlejandroM
      @ARQAlejandroM 6 років тому +1

      can you explain what do you mean with less maintanence, please? :-)

    • @trappedcat3615
      @trappedcat3615 6 років тому +3

      Alejandro Montes depending on what contexts and how the new object is used, it may require a lot binding of the "this" keyword.

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

      Circle.call({ },3); but if it is nameless how do we access it? I tried " const another1 = Circle.call({ },3); " but it is undefined in my browser. Any thoughts?

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

    I love your teaching style. You explain things in simple terms without all the hyped up buzz words. Only suggestion is to remove the old code fully when modifying things going from one example to the next. That could cause confusion for beginners. Also in your circle draw example you don't define the draw function beyond logging the word draw to the console which doesnt actually show how a function in a factory works.

  • @EricFransen1
    @EricFransen1 6 років тому +5

    18:32 "in JavaScript we don't have the concept of classes" said while explaining ES6 new JavaScript features.

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

      @@programmingwithmosh Oh god, is the class syntax completely useless then? Can at least be used as a good practice?

  • @newthepanch
    @newthepanch 5 років тому

    omg dude, you rock so bad, i've been digging around looking for a good js tutorial or book and i came to you by a facebook group, im going to the complete course and become a pro, thank you so much.

  • @ahmadmuqadas78
    @ahmadmuqadas78 2 роки тому +9

    im so confused when he says in javascript we don't have concept of classes while we do have class in ES6.

    • @BerryTronics007
      @BerryTronics007 9 місяців тому

      So i need to understand Java😬

    • @Sammysapphira
      @Sammysapphira 8 місяців тому

      Classes are syntactic sugar prototype inheritance in javascript and they do not function as classes in OOP languages. He is talking about the function under the hood.

    • @vishnu2407
      @vishnu2407 6 місяців тому +1

      This was back in 2017

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

    Amazed on how simple you make the things, mate.