SHARE

Hey ninjas, I think it’s about time we started using constructor functions to create our objects! So in this JavaScript tutorial for beginners I’ll introduce it to you!

The constructor function is useful if you are creating many objects of the same ‘type’ – e.g. many different Car objects. It promotes DRY code (don’t repeat yourself) and saves a lot of time when creating many objects!

Any questions, fire away 🙂

SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1

========== JavaScript for Beginners Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9i9Ae2D9Ee1RvylH38dKuET

========== CSS for Beginners Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9gQeDH6xYhmO-db2mhoTSrT

========== HTML for Beginners Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9ibZ2TSBaGGNrgh4ZgYE6Cc

========== The Net Ninja ============

For more front-end development tutorials & to black-belt your coding skills, head over to – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk

========== Social Links ==========

Twitter – @TheNetNinja – https://twitter.com/thenetninjauk

20 COMMENTS

  1. Have been ready tons of JavaScript books, taken full online courses, and watched more videos than is healthy for one human being. Without a doubt, yours are the best, most understandable, and helpful ones I’ve ever watched. Concise, logically arranged, just enough content per video. Well done. I think I actually understand JavaScript enough now to actually use it myself. Good work, Ninja!

  2. These are the best Javascript tutorials I have seen so far. Easy, concise, to the point and explained in an very logical way. Thank you! I'm a huge fan of your teaching method.

  3. I wrote the exact code and chrome keepsaying unexpected error on the this.maxspeed = maxspeed ; , i dont know why ! Why ?

  4. However you are way faster than the ninja man but I have one question, suppose, if I have to call 20 cars, so iI need to write 20 lines of codes for only calling the constructor, is there any ways to go for loops, if yes, then how?

  5. Bro I am facing a problem. The problem is the starting sound of your videos is so annoying! and I don't want to skip any part of the video because it's distracting. Also, if any old guy want to start learning from your video then I don't know what's gonna happen…

  6. This is really well explained, once I tried to learn constructor functions from a book and couldn't get it. I've learn it easily from this tutorial, I've found out that those functions are quite simple. I guess I don't have talent for learning from books or you're just a good teacher!

  7. Nice tutorial man!
    What's the difference between a constructor and a regular function? Why and when would you use one over the other?

LEAVE A REPLY

Please enter your comment!
Please enter your name here