Javascript Objects Explained | Javascript Objects Tutorial

Поделиться
HTML-код
  • Опубликовано: 18 янв 2025

Комментарии • 68

  • @laceyhunter2209
    @laceyhunter2209 Год назад +7

    This is my 5th instruction I have done but only video that made it all click. He shows us how to write an object, different things your can do with an object AND gives an overall view of what objects can do. Now that he’s put it into perspective for me it makes so much more sense to me. Thank you!

  • @godismyway7305
    @godismyway7305 Год назад +5

    If good people like you make a video like this on each basic JavaScript topic, JavaScript would not take a year and more to master. Thanks and subscribed!

  • @Grihlo
    @Grihlo 2 года назад +12

    Thank you for introducing objects with these creative examples! I believe that using cool examples makes lessons really involving.

  • @yatin1370
    @yatin1370 Год назад +1

    Beautifully compiled, it was fun exploring and understanding this lesson!
    Edit: I would like to summarize the ways object/s can be created in JS (that I know of), because it created some confusion during my learning.
    1. Object literals ( eg: 'anotherObj' at 2:17)
    2. Object.create() (eg: 'truck' at 7:35)
    3. Factory functions (shown in next lesson)
    4. Based on a created Class (shown in next lesson)
    5. Constructor functions (very close to classes concept, shown in lesson#20 while creating 'customError' function)
    Hope this helps someone while following this awesome playlist 😇

  • @osayieseosa
    @osayieseosa Год назад

    Half way into thus video and I keep asking myself "who is thus guy" you've got my sub

  • @SkhinBgub
    @SkhinBgub 10 месяцев назад

    I have been looking for this type of high quality content.
    you are underrated

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  10 месяцев назад

      Thank you!

    • @jonathanmornes3914
      @jonathanmornes3914 7 месяцев назад

      I don't know how he got the string in the console when it said guitar by so and so, vocals by this name and so on

  • @davides3610
    @davides3610 Год назад +1

    I just want to thank you for your tutorials. Great explanation!

  • @viewit2116
    @viewit2116 2 года назад +1

    Thanks for this, I appreciate, though I sti struggle a little with loop but I just found out about you for a few months now and I wish to be this good and more, you inspire me. Some people who are also studying coding are suprised at my growth and it's all thanks to you. Whatever you serve, God bless you man.🙏🏻

  • @siten1
    @siten1 Год назад

    Beat examples/explanations I've seen. Thank you!

  • @Kubaassasincreed2
    @Kubaassasincreed2 11 месяцев назад

    The best video on JS objects on youtube. Props for Led Zeppelin reference! 🎸

  • @camip1519
    @camip1519 Год назад +2

    thank you for efforts , really great way of teaching 😄

  • @CondeAlberto
    @CondeAlberto 2 года назад +2

    Very good explanation of "this". Another great video.

  • @aarongoulding4025
    @aarongoulding4025 4 года назад +2

    Another great video! How do I log to the console the FULL properties of an object, including the properties that come from the parent object?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  4 года назад +3

      When an object is printed through console.log, it is printed with all its own properties and a link to the object it inherits from. You can see all the inherited properties in console, you just need to follow the prototype chain of the displayed object (typically using __proto__ or [[prototype]] keys). This answer is a direct quote from here: stackoverflow.com/questions/31100403/how-to-console-log-all-inherited-properties Thanks 👍

  • @mfarrise
    @mfarrise 9 месяцев назад

    If u know what are classes in other language and just want to know the syntax in js . This the best info/time video

  • @hadibq
    @hadibq Год назад

    Wow , powerful tricks with objects!! Nice👍

  • @JohanDippenaar
    @JohanDippenaar 2 года назад +1

    Fantastic tutorial.

  • @Joseph.Ashenafi
    @Joseph.Ashenafi Год назад

    🥰🥰🥰 ur lectures are awsome

  • @kapall3021
    @kapall3021 Месяц назад

    what the diffence between const tom= new Person() or const tom = Object.create(Person) ?

  • @craigfreeburg5910
    @craigfreeburg5910 4 года назад +1

    The chuckle at 15:08 made me LOL

  • @BukkyOdunsi
    @BukkyOdunsi Год назад

    God bless you so muchhhh, i couldn't get objects until now 😭

  • @thee3a
    @thee3a 2 года назад

    Thank you so much for the great tutorial!!

  • @filipebranco1543
    @filipebranco1543 Год назад

    Thank you, thank you, thank you!!

  • @KairatAbdykalykov-i9d
    @KairatAbdykalykov-i9d Год назад

    thank you for your tutorials≥≤

  • @DarthVader-wd9sc
    @DarthVader-wd9sc 2 года назад

    I have a question. Since all non primitives are objects in the end of the prototype chain, do arrays and functions and all the other non primitives have access to all the methods from Object.prototype? What happens if we try to access properties/methods of Object.prototype on an array?
    Thanks in advace.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 года назад +1

      You can explore this. Open the Chrome devtools window and in the console, create and log an array. Do the same for any object. Expand the properties for each.

    • @DarthVader-wd9sc
      @DarthVader-wd9sc 2 года назад

      @@DaveGrayTeachesCode Thank you for the reply.
      i did console an array and go up the prototype chain. I saw object methods up in the chain. And when a property or method is being accessed, the whole prototype chain is being searched right? My question is, is it ok to access object methods on an array?
      Thank you.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 года назад +1

      @@DarthVader-wd9sc they are array objects and have their own Array methods. MDN: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array

  • @kanchandhyani2307
    @kanchandhyani2307 10 месяцев назад

    Please also explain prototyping concept

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  10 месяцев назад

      I have a video on that: ruclips.net/video/mQ4oCgcgHOA/видео.html ..not part of a beginners playlist or course though.

  • @akj3388
    @akj3388 10 месяцев назад

    To add object within an object, use my method, you won't find it elsewhere:
    var obj = {};
    var obj2 = {name:'Jack',age:155};
    var fun1 = function (obj01,obj02){
    return obj01['obj02'] = {};
    };
    var nestObj = fun1(obj,obj2);
    var fun2 = function(nestObj2){
    nestObj2.name = obj2.name;
    nestObj2.age = obj2.age;
    }
    fun2(nestObj);
    console.log(obj);

  • @karkisanket294
    @karkisanket294 2 года назад

    It would be great if you provide notes which we (viewers) can use to revise what we read. Or you can just tell website which you look before giving this explanation.We can see that website for note making

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 года назад

      I usually provide a few links in the description. You can look up any of these Javascript topics on MDN: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object

  • @jamshidtashkent1976
    @jamshidtashkent1976 2 года назад

    Awesome!!!

  • @ChrisWalker-pd2xn
    @ChrisWalker-pd2xn Год назад

    Good Stuff

  • @estandepinga
    @estandepinga Год назад

    that was nice

  • @narcleptik
    @narcleptik Год назад

    thanks

  • @joshhodgson3659
    @joshhodgson3659 2 года назад

    i almost cried when you deleted john bonham 😥

  • @Abe-Oluwatomisin
    @Abe-Oluwatomisin Год назад

    This looks like python dictionary buh kinda different

  • @mervinmarias9283
    @mervinmarias9283 Год назад

    The answer is always 42

  • @Brawlstriker89
    @Brawlstriker89 Год назад

    Cool tutorial but I feel you leave out/skip over very crucial information as you go along. Because you already know it. Things such as putting commas, making sure semi colons are put in. All tutorials I’ve seen leave out these important syntax’s

    • @BbB-vr9uh
      @BbB-vr9uh Год назад

      Commas yes, but js doesn’t require semicolons. You can put them or not.

    • @Brawlstriker89
      @Brawlstriker89 Год назад

      @@BbB-vr9uh No, JavaScript doesn't strictly require semicolons, but using them is considered good practice to avoid potential issues with automatic semicolon insertion.

    • @Brawlstriker89
      @Brawlstriker89 Год назад

      Automatic Semicolon Insertion (ASI) is a feature in JavaScript that automatically inserts semicolons at the end of certain lines if they are missing. While this can help avoid syntax errors, relying on it can lead to unexpected behavior, so it's recommended to include semicolons explicitly in your code.

  • @susieoneil5706
    @susieoneil5706 3 месяца назад

    Hi, I added a few lines to help me understand the last point. Might be useful for someone...
    // a function that looks for a key when passed an object.
    function sings({ vocals }) { return `${vocals} sings.` };
    console.log(sings(band)); // output: "Robert Plant sings"
    const orchestra = { vocals: "Pavarotti" }; // new object
    console.log(sings(orchestra)); // output: "Pavarotti sings"

  • @kcell2042
    @kcell2042 2 года назад +3

    Thanks for great tutorials!
    _____________________________
    Whole Lotta Code (Love) - D. Zepp. 🎸
    You need coding! (cooling) ... ⌨️

  • @JFloridaTech
    @JFloridaTech 2 года назад

    Tesla.engine = () => { return “🔥🚗💥” }