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




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


29 responses to “JavaScript Tutorial For Beginners #28 – Creating a new JavaScript Object”

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

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

    };

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

Leave a Reply