• Tuesday , 31 March 2020

JavaScript Tutorial For Beginners #28 – Creating a new JavaScript Object

Code Canyon



Hey ninjas, in this JavaScript tutorial for beginners, we’ll make our very own object using the car analogy from the last lesson. I’ll show you how to create the object, add properties and methods, and finally how to use the shorthand notation to do this.

As always, if you have any questions, fire away :).

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

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

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

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

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

Original source

3d Ocean

Related Posts

29 Comments

  1. Tony Cunningham
    November 23, 2019 at 19:06

    ok, dude, love the vids, but i keep getting this error after following your code to the letter… Uncaught TypeError: myCar is not a constructor.. please help

  2. Arno Pisspot
    November 23, 2019 at 19:06

    one of the best js object explanation I have seen. Greatly appreciated sir.

  3. Stephen Defren
    November 23, 2019 at 19:06

    I'm loving these video tutorials. Just bought a hoodie to show the love. Thank you!

  4. Rayna Willow
    November 23, 2019 at 19:06

    Hi! I'm just wondering how come you can just put in myCar.maxSpeed myCar.driver but you have to put a function in myCar.drive. And what is the function doing? please help!

  5. Łukasz Cezary
    November 23, 2019 at 19:06

    Thx! 🙂

  6. Deep Roy
    November 23, 2019 at 19:06

    I have tried removing the semi colon and ran it on the browser …to my surprise it works even then! What is the use of the semi-colon?

  7. Rania design
    November 23, 2019 at 19:06

    great lesson thanks a lot

  8. Abhishek kumar
    November 23, 2019 at 19:06

    Every thing is okay, But what is the use of "New" key word

  9. Chris Guy
    November 23, 2019 at 19:06

    Brilliant!

  10. Swathi S Reddy
    November 23, 2019 at 19:06

    Shouldn't "speed" and "time" variables used in the function be defined before using them??

  11. Md Rohim Sikder
    November 23, 2019 at 19:06

    your every tutorial video is short…………….

  12. Syed Baryalay
    November 23, 2019 at 19:06

    seriously you are the one ring to rule web development courses. Your tuts are great ah.

  13. Marl Piece
    November 23, 2019 at 19:06

    hi ninja just to clarify, about that
    var mycar 2 = {
    driver: function() {}
    }

    so basically it says that, whatever result in the function () will be assign to property name driver right? and the driver will be the property of mycar 2

  14. Yasmine tariq
    November 23, 2019 at 19:06

    This is really excellent. Explained in much details; I think whoever thought javascript was too hard to learn before will change his/her mind after watching your videos. Brilliant teacher, Well done!

  15. Kervin Camantoy
    November 23, 2019 at 19:06

    Easy to learn, easy to understand thanks for the lectures. Hope to learn more from you!.
    18 Videos to go!! (Road to Front End Web DEsigning)

  16. Prajakta Ingle
    November 23, 2019 at 19:06

    Great video!!! 🙂

  17. Matt Arcarese
    November 23, 2019 at 19:06

    This was amazing. I've never seen objects so easy to understand.

  18. MrSULTANC2
    November 23, 2019 at 19:06

    awesome

  19. lologic
    November 23, 2019 at 19:06

    does the shorthand automatically create a new object?

  20. Bulkislove Bulkislife
    November 23, 2019 at 19:06

    was a lot to take in this episode, but ithink i got the hang of it very soon!

  21. The Web Master
    November 23, 2019 at 19:06

    He is typing WAY too fast!

  22. hollowmind
    November 23, 2019 at 19:06

    Hi, I would like to ask is it a must to print something out from the function /methods as i had noticed that you would include console.log in the function or setting a value for the function. Is there a way of not printing anything using the method of:

    var myCar ={
    properties
    method

    };

  23. Tobias Wilhelmsson
    November 23, 2019 at 19:06

    Hi great videos!!
    I have a question. maybe I'm stupid and did something wrong here.
    i got the result "undefined" when i make my code like this.

    var name = new Object();
    name.age = 50;
    name.lastName = "Jenny";
    name.age = "Johan";
    name.eyeColor = "blue";

    console.log(name.age);

    cant i use name as an variable to be an object or what did i do wrong here?

  24. siddhartha rao
    November 23, 2019 at 19:06

    var a= new Object();
    a.speed = 100;
    a.driver = 'dell';
    console.log(a.driver);

    (or)

    var a =
    {
    speed = 100;
    driver = 'dell';
    console.log(a.speed);
    }

    what's the difference?which one can i use?

  25. Dan Lee
    November 23, 2019 at 19:06

    Gahhh that slicing sound in the beginning when you have your headphones on to the max HURTS! 🙁

  26. es_python Develop
    November 23, 2019 at 19:06

    it's a very good tutorial i like it but i need a good reference or a book could you recommend one for me ?

  27. Rakesh Debnath
    November 23, 2019 at 19:06

    It's getting little bit complicated! :-/

  28. GreciaR7
    November 23, 2019 at 19:06

    You're a great teacher. Everything is clear and easy to understand. Thank you for uploading all these tutorial videos.

  29. Micheal Bailey
    November 23, 2019 at 19:06

    Great tutorial man, quick simple and gets right to the point.

Leave A Comment

You must be logged in to post a comment.