• Friday , 20 October 2017

Beginner JavaScript Tutorial – 25 – Creating Our Own Objects

Code Canyon



Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts

Original source

3d Ocean

Related Posts

43 Comments

  1. Miha Rajster
    September 13, 2017 at 10:10

    I am still depressed..

  2. cat lady
    September 13, 2017 at 10:10

    I'm not bothered about the age math. I think this explanation of constructor functions
    Made the muddy stuff clear as crystal for me thanks a big bunch

  3. Oscar nnn
    September 13, 2017 at 10:10

    kennel cough lmaooooo

  4. Victor Liebenberg
    September 13, 2017 at 10:10

    WAIT!!. So your mom gave birth to you when she was 14?

  5. AJay Gupta
    September 13, 2017 at 10:10

    Lovely Bucky!! Enjoyed watching ur Tutorials!!

  6. TheAceRaichu // epicguymc
    September 13, 2017 at 10:10

    It didn't even make any physical objects

  7. ColesContent
    September 13, 2017 at 10:10

    holy feild

  8. WolvesFanVideos
    September 13, 2017 at 10:10

    Couldnt you just do this?

    var object1 = {
    name: 'Pete',
    age: '69',
    };

    document.write(object1.age);

  9. Market Hydra
    September 13, 2017 at 10:10

    I love you bucky

  10. Daksh Sharma
    September 13, 2017 at 10:10

    FYI-
    'this' is only for the contextual reference of an object and can be used as a pronoun(in a way)
    imagine this sentence: Bucky is a good man. Bucky likes to code….?
    So in programming world, 'this' keyword provides simplicity along with what all Bucky has mentioned.

  11. Daniel Somoghi
    September 13, 2017 at 10:10

    Dude you're fucking amazing. You should teach or something. I wouldn't skip a class

  12. Muhammad Salman
    September 13, 2017 at 10:10

    guyz its so easy to learn if u do not understood it see video again and again u will automatically understand this and every thing take time nothing u can learn in one day and bucky is awesome

  13. Delhi Developer
    September 13, 2017 at 10:10

    Sorry buddy!
    But just conceptually you were very wrong.
    Actually what you have defined is not an object but a class. And what you are calling an "instance of an object" is actually an "instance of a class". Object is itself an "instance of a class". Not that you are teaching wrong coding. Your lectures are good. But its just that the nomenclature you just used at the end was quite wrong. Hope you can correct it now!

  14. VAIBHAV SHAH 15BCE0266
    September 13, 2017 at 10:10

    <!doctype.html>
    <html>
    <head>
    <script type="text/javascript">
    function a(fname,lname,age)
    {
    this.fname=fname;
    this.lname=lname;
    this.age=age;
    }

    </script>
    </head>
    <body>
    <script type="text/javascript">
    var x= new a("ana","cheri",28);
    var y= new a("margot","robbie",28);
    var z= new a("leo","messi",29);

    document.write(x.fname + x.lname + x.age +"<br/>");
    document.write(y.fname + y.lname + y.age +"<br/>");
    document.write(z.fname + z.lname + z.age +"<br/>");
    document.write(x.length+ y.length + z.length +"<br/>"); // why it's showing undefined ..??
    </script>
    </body>
    </html>

  15. Magan Hassan
    September 13, 2017 at 10:10

    In OOP lanaguages like Java we use classes as a way to organise similar objects, I'm just wondering how comes we can't do something like that in javascript? you can do it in PHP.

  16. Daski69
    September 13, 2017 at 10:10

    bucky's mom had bucky at 14

  17. Sean Barry
    September 13, 2017 at 10:10

    Bought a book on this and it confused the fuck out of me. When you explain it, I can actually follow along…Thank you Bucky

  18. nowekonto2
    September 13, 2017 at 10:10

    "say that and your teacher will probably get a hard on or something" lol

  19. Jatin sharma
    September 13, 2017 at 10:10

    Is there a way to print of all the properties of an object together or we can only do them separately??

  20. Nicholas Noriega
    September 13, 2017 at 10:10

    I did:
    <html>
    <head>
    <script type="text/javascript">
    function person(name, age){
    this.name = name;
    this.age = age;
    }

    var Nick = new person("Nicholas Noriega", 23);
    var Taylor = new person("Taylor Swift", 20);
    </script>
    </head>
    <body>
    <script type="text/javascript">
    document.write(Nick.name);
    document.write(Taylor.age);
    </script>
    </body>
    </html>

    And only My name popped up as Nicholas Noriega23… How do I display two?

  21. Sasha naidu
    September 13, 2017 at 10:10

    bucky can classes be possible in javascript??
    can u teach us based on it, pls

  22. yerrapotu kiran
    September 13, 2017 at 10:10

    Y do we have to do this object thing when we can do this
    <script>
    Function fusky(a,b){
    document.write(a+"loves"+b);
    }
    Fusky("Bucky","Taylor");
    Fusky("Bucky","Jennifer");
    Fusky("Taylor","Roberts");
    </script>

  23. Sammie R
    September 13, 2017 at 10:10

    Hey bucky, I am wandering how do you tailor this to get the user input from a input tag?

    PS: Taylor Swift is 26

  24. Le dragon Bleu
    September 13, 2017 at 10:10

    How did you know all this ( biology, chemistry , c++, JavaScript …..) and you dropped the college , respect , you gave me inspiration and keep up

  25. Karthick Elangovan
    September 13, 2017 at 10:10

    Function creating object!! Strange and useful!!! Thanks!!!

  26. Ross O'Leary
    September 13, 2017 at 10:10

    You should probably stop objectifying Taylor Swift. ๐Ÿ˜‰

  27. Violetpaw
    September 13, 2017 at 10:10

    hello!, I was wondering if in the game i play, i can use this to make any item in the game?

  28. Mike Brice
    September 13, 2017 at 10:10

    oh wow this is awesome. I had no idea you could do Objects in javascript!

  29. Travis G
    September 13, 2017 at 10:10

    All your videos are good thanks, I appreciate it.

  30. Knighthalt Frain
    September 13, 2017 at 10:10

    You're 24 and you're mom's 38 wow she's young for a mother .

  31. King Farouk
    September 13, 2017 at 10:10

    it reminds me of the structure in C programming

  32. thatOneAmar Amar
    September 13, 2017 at 10:10

    Well explained. Thank u ๐Ÿ™‚

  33. Suren Danielyan
    September 13, 2017 at 10:10

    would you really say it is stupid to use "this" in this context? to me it's the clearest example of "this". I mean, "this" has a lot if misinterpretations, but I wouldn't say this is one of it. how would you select the current object if not?

  34. Hardik Kardam
    September 13, 2017 at 10:10

    Your mom is 38 and you are 24 ?… means 38-24=14 was her , when you spawned .

  35. Urketadic
    September 13, 2017 at 10:10

    You could write computer and then just write "Doesnt have a computer" in that objects property.

  36. Mervin Lee
    September 13, 2017 at 10:10

    I am just wondering, how do you know which codes are case sensitive? For example: If I write the array in lower case, then it won't work but writing it in upper case will? Thanks!

  37. Robert Reimann
    September 13, 2017 at 10:10

    Guys, I rage-quited at this tutorial about 3 months ago. Now I came back to learn some stuff, but I don't remember anything I have learned about HTML, CSS and JavaScript already. lol Wish me luck cause I want to become the best JavaScript programmer in the world ๐Ÿ˜€

  38. 1chocolu
    September 13, 2017 at 10:10

    But how do we create new instances from outside JavaScript? Like with an HTML button?ย  Is that possible?

  39. Hunter Roberts
    September 13, 2017 at 10:10

    "Either she is 20, or she will be. I don't know, good enough" haha love this! Thanks man!

  40. Roy Miller
    September 13, 2017 at 10:10

    Thanks, so much bro I struggle like no tomorrow learning OOP in JavaScript after learning it in PHP it's so weird and diffrent.

  41. Kat Rejkiewicz
    September 13, 2017 at 10:10

    Bucky's mom 38??

  42. wogalwogal wogalwogal_Earle
    September 13, 2017 at 10:10

    may a say ,, your great presenter , you have a gift for – conveying information in a easy to understand manner ,, thank you for what you do ,, – Earle

  43. nychold
    September 13, 2017 at 10:10

    Can't speak about JavaScript instructors as I'm self taught with that, but objects don't need instantiation. It's classes that need instantiation, but even if objects in JavaScript are synonymous with classes, it's to avoid confusion between the following:

    "I'm going to create a new object to handle the data."

    …did I just say I need a new instance to handle the data, or am I writing new code to handle the data? You don't really know, and ambiguity in programming is the fastest way to Bugsville. So:

    "I'm going to create a new object…" means "I'm going to write code…"

    and

    "I'm going to instantiate the object…" means "I'm going to USE an object…"

    There really is a reason for it beyond "giving your professor a hard on."

Leave A Comment

You must be logged in to post a comment.