Object keys, values, and entries methods

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

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

  • @daeroi3116
    @daeroi3116 3 года назад +6

    I really needed this. Concise, clear, straight to the point, and easy to understand. I don't get why free RUclips videos break down concepts way better than courses I had to go and pay for. Thanks a lot.

  • @guiguitoLemon
    @guiguitoLemon 5 лет назад +29

    Dude, straight to the point. Everything I needed, and although simple it was so hard to find it all compiled in one go like that. Go Canada!

  • @kris8536
    @kris8536 4 года назад +10

    Steve, you helped me solve in 2 minutes what I have spent the last hour on. THANK YOU!

  • @vladislavbarbarii2089
    @vladislavbarbarii2089 6 лет назад +23

    Great explanation. Thanks a lot

  • @TheMCVR
    @TheMCVR 5 лет назад +6

    Super depth in your voice, I like your voice very much it is very pleasant to hear.

  • @vladimirzizic6874
    @vladimirzizic6874 4 года назад

    I didn't think I even needed any further clarification on objects and arrays until I came across this video. This was perfectly explained.

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

    Prof, your videos are devoid of fluff. You go straight to applicable functionality. Thanks for making it easier.

  • @calebcadainoo
    @calebcadainoo 3 года назад +1

    Very clear an concise 👌. Thanks man

  • @staffordokoth5851
    @staffordokoth5851 3 года назад

    I had to stop the video at 2:35 to come and thank you for your explanation. Straight and precise.Thank you again Steve

  • @jd_flick
    @jd_flick 3 года назад

    probably the best video I've seen on explaining this

  • @jessicarodrigues-dlouhy575
    @jessicarodrigues-dlouhy575 2 года назад

    YOUR EXPLANATION WAS WONDERFUL!!!!!

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

    Wow man, that was really very great! Thank you a lot. I've been looking up tutorials on the subject for the whole day... And this tutorial here is the best by far :)

  • @soyaro
    @soyaro 5 лет назад +2

    Thanks Steve, you've saved me hours of debugging!

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

    Well-detailed explanation straight to the point.

  • @Jeff-2112
    @Jeff-2112 6 лет назад +1

    I wasn’t aware of those methods. Great explanation as always!

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

    Simple yet elegant explanation. Thanks a lot!

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

    Great Video.
    Short and straight forward

  • @cjm101
    @cjm101 3 года назад

    I'm new to all of this and the way you explain is so clear. Thank you for these videos!

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

    I'm going through codecademy at the moment and there are bits that confuse me for various reasons, these videos you've uploaded are helping massively! They have helped me cement so many bits of knowledge in place and I feel like i see clearer afterwards :D

  • @jOGDPDJZ
    @jOGDPDJZ 5 дней назад

    dude I love you , you're literally saving my ass for my exams lol

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

    Thx for the video, I was lost as to the difference, and this video made it clear.

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

    best video for keys, values and entries., you gained a subscriber.

  • @rotrose7531
    @rotrose7531 4 года назад

    Your tutorials seriously provide something one really want to learn. Thank you very much,.

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

    Thank god I know english, because your class was AMAZING, so simply! Thanks

  • @ChrisTian-ox5nr
    @ChrisTian-ox5nr 4 года назад +1

    Great Technical communication. Thank You! This is a very good Tutorial.

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

    Amazing explanation. Thanks so much!

  • @mishanwong2393
    @mishanwong2393 4 года назад

    Thank you so much Steve! This is very easy to follow and it helps me out a lot!

  • @martingustafsson3828
    @martingustafsson3828 5 лет назад

    Great tutorial! Straight to the point and well explained.

  • @BestFoodReviewFeatured
    @BestFoodReviewFeatured 3 года назад

    Thank you, this has help me understand better what .keys and .entries does.

  • @harsh_here
    @harsh_here 3 года назад

    You're a legend, Sir. Thank you so much!!!!

  • @danielaparicio3692
    @danielaparicio3692 5 лет назад

    THANK YOU STEVE, this explanation helped so much

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

    simple and great explained! thanks

  • @beccaadolph
    @beccaadolph 4 года назад

    Excellent Video - thank you.

  • @madeyeatreides4055
    @madeyeatreides4055 6 лет назад +1

    Thanks this helped me, love the GOT reference😂

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

    Wow, absolutely amazing 🙏

  • @codeymaze.
    @codeymaze. 3 года назад

    Easy explanation . Thank you

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

    Hey Steve! I think you're one of the die-heart fan of Game of Thrones as I am...🍷
    Well, thanks a lot for this tutorial!
    By the way which is your favorite character in GOT?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 года назад +1

      Hard to say. There are many great characters. The Hound, Jorah Mormont, Tyrion, Arya, ...

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

      @@SteveGriffith-Prof3ssorSt3v3 Well that's a lot of names, but my favorite forever is ''Tyrion''. 😊
      And I'm eagerly waiting for 'House of Dragons'. Hope you are too.

  • @tonykieling7664
    @tonykieling7664 6 лет назад

    Very clear and objective!! Thanks!

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

    Great explanation
    BTW nice to see a GOT fan

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

    today I simply learned something interesting from this vidyo. Thanks for uploading.
    😍

  • @kranthikumar5215
    @kranthikumar5215 3 года назад

    You are a great teacher

  • @chrislopez9665
    @chrislopez9665 3 года назад

    Thank you so much! Great video!

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

    Thank you for making this video

  • @anshulmanapure1980
    @anshulmanapure1980 3 года назад

    Steve, this work of yours is gold. Truly.
    Edit: One doubt though. What if we had an anonymous function as a value of some key inside an object. What happens to that? I'm fairly new to JS and programming in general, but I haven't saw we declaring a function inside an array.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 года назад

      The values assigned to the keys in an object can be anything, including an anonymous function.
      Functions in JavaScript are first class citizens. They can be passed around like any variable.

  • @SrtaNatyOliveira
    @SrtaNatyOliveira 5 лет назад

    Oh god... thank you so much! Great explanation! Following the channel right now

  • @muhammadashfaq913
    @muhammadashfaq913 5 лет назад

    Great explaination thumbs up

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

    Excellent, Stright to the Point

  • @nedlathium9492
    @nedlathium9492 5 лет назад

    Perfectly explained, thank you !

  • @josephgarza5973
    @josephgarza5973 3 года назад

    Thanks a lot for the helpful video! Awesome job!

  • @adziiia1
    @adziiia1 4 года назад

    thank Steve , nice explanation!

  • @nasirshaik2662
    @nasirshaik2662 6 лет назад

    very detailed explanation thankyou some much

  • @sureshanands8594
    @sureshanands8594 5 лет назад

    Nice explanation .. , 👏👏✌

  • @claystation6360
    @claystation6360 5 лет назад

    Thanks buddy! Great video, gunna subscribe. You have a nice teaching style

  • @DeepakSingh-oj9ot
    @DeepakSingh-oj9ot 5 лет назад

    awesome Explanation..

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

    great explanation thank you and westeros example it's very nice too :D

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

    Very clear. Thanks @SteveGriffith

  • @SergioTortosa60m32
    @SergioTortosa60m32 5 лет назад

    Thanks for the explanation.

  • @alexsilva820
    @alexsilva820 5 лет назад

    So great bro I love those methods

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

    Really very helpful. Thank you so much :)

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

    Very good video 1000 likes for u

  • @chesterxp508
    @chesterxp508 3 года назад

    Another very cool tutorial!

  • @jordancoakley4832
    @jordancoakley4832 4 года назад

    Great video. Thank you, helped alot!!!

  • @olawaseem
    @olawaseem 5 лет назад

    Thank you from the heart.

  • @milanm9907
    @milanm9907 6 лет назад

    thank you , great explanation!

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

    Helped a lot, thanks !

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

    very well explained

  • @Martin-sy4jt
    @Martin-sy4jt 3 года назад

    THANK YOU 👏👏

  • @ademolaadeagbo9011
    @ademolaadeagbo9011 5 лет назад

    can't help it, just had to comment this is really good. keep it up

  • @christmasvillage3652
    @christmasvillage3652 5 лет назад

    lol I am guessing that you may be a fan of Game of Thrones? Nice explanation of the three functions for object. Thank you so much.

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

    Amazing, thank you!

  • @artsenm1327
    @artsenm1327 6 лет назад

    Great tut Steve. 👍

  • @mustafaalawad2667
    @mustafaalawad2667 6 лет назад

    thanks a lot you are amazing and your explanation was so great and useful :)

  • @MuhammadSamiViewer
    @MuhammadSamiViewer 4 года назад

    Great Explanation Brother! You Deserved A Like From ME! Great Teaching Skills For Newbies.

  • @aidangasim
    @aidangasim 4 года назад

    brilliant clarifying,,,thanks so muchhh)

  • @bribes_for_nouns
    @bribes_for_nouns 4 года назад

    So say we convert an object to an array so we can use methods on it easier. After doing this, how would we convert the newly updated array back into the object that it came from?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад +1

      We wouldn't. We would have the original object plus the new information we got from the array methods.

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

      Dock Adams if it's a two dimensional array, then we can use the Object.fromEntries(arr) to convert back to object

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

    Could you give any advice on how you'd access a specific entry without knowing the index number? Like if you were wanting to log 'Snow' without knowing it is [2][1], but you knew the key was 'jon'.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 года назад

      The key concept is accepting the fact that objects are not built with sequential properties. There is no number associated with the properties. Object.keys() gives you a list of the possible properties. Don't think of it as the order of properties.

  • @jp-hz6br
    @jp-hz6br 4 года назад

    How do you change the name of a key. Say, if I wanted to add an ‘s’ character onto the end of keys that held array objects as their values?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад

      You cant change the name of a key. You can create a new key, copy the value of the old key to the new key and then delete the old one.

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

    A fellow GOT fan

  • @elchino7672
    @elchino7672 3 года назад

    Hi. Thank you for great esplanation. Question: How add new value in one of these array?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 года назад

      These arrays are generated by the methods entries, values, and keys. If you add a new property to the object then the methods will return a new updated array.

    • @elchino7672
      @elchino7672 3 года назад

      @@SteveGriffith-Prof3ssorSt3v3 Thank for reply. Steve, I mean if I have an object with multiple arrays and I want to push random into one of these array any value what would be logic? Say, there is object { arr1[], arr2[], arr[] } and I want to push 'some value' into one of these arrays in my object. But I want it to do randomly and each array wont have any dublicates

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 года назад

      @@elchino7672 That's several different things you are asking. Avoiding duplicates in arrays I talk about here - ruclips.net/video/uTGRJqn889Q/видео.html
      You can also covert to a Set and then back to an Array to remove duplicate values.
      Picking a random value - ruclips.net/video/hnOAL4qW5yY/видео.html
      myObject['arr1'].push( newThing ) is how you could add something to the array called arr1 inside of myObject.
      Here is my whole playlist about Arrays - ruclips.net/video/arIhhRd1RPc/видео.html

  • @Salmooooon_oO
    @Salmooooon_oO 2 месяца назад

    I totally understand, thx

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

    thank you so much sir

  • @spetsnazGru487
    @spetsnazGru487 4 года назад

    if you create an array, you have a .entries method with that array, how to use that. When i logged in console, it says iterable array.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад +1

      When you call the entries( ) method what you get is an array of arrays. Each of the inner arrays has two items - the key and the value. the key is item [0] and the value is item [1].

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

      @@SteveGriffith-Prof3ssorSt3v3 thank you very much.

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

    Thanks mate.

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

    Hi Prof.Griffith How do i convert ["3,1", "4,2", "5,10"] into key vals

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 года назад +1

      use any loop method you want (array map is best to create a new array from the old), take each string as you loop and call split(",") to break it apart on the comma. Then you have the two parts and can use the first part as the key and the second as the value.

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

      @@SteveGriffith-Prof3ssorSt3v3 thankyou appreciate it

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

    What a great voice!

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

    This is great. How about other types of operations that could be done using an object like this?
    For example working with arrays against an object. How did it work superficially and under the hood?
    Thx

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 года назад +1

      I have a whole playlist about Arrays - ruclips.net/video/arIhhRd1RPc/видео.html
      If you search for the keyword "Object" on my channel you will find a bunch of other related videos too.

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

      @@SteveGriffith-Prof3ssorSt3v3 I'll go and look for the. I found code that goes like this let obj = {}:
      Let arr = ('a','b,'c');
      And at some point in a loop they go like this this obj[arr[i]] . I was wondering, in gullible mode, if this a multiplication of some sort. I.e A*B(i)??I??? 🙂

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 года назад

      @@jaimedpcaus1 Not multiplication. Nested looping. ruclips.net/video/AqgVLYpBWG8/видео.html

  • @alexhitchins4339
    @alexhitchins4339 4 года назад

    FANTASTIC!!! Such a good explanation. Thank you very much!

  • @listgaus
    @listgaus 4 года назад

    Great explanation, has anyone mentioned you sound just like Tyrion? it felt a bit like im listening to him guiding me trough object methods :P

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад +1

      Lol. Haven't heard Tyrion before. Bob Ross, Liam Neeson, Christian Slater, Bryan Cranston, Corpse Husband, Tiger Dad, and lots of others. 😀

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

      @@SteveGriffith-Prof3ssorSt3v3 haha maybe the object's context gave me the reference :P

  • @Mrshaider79
    @Mrshaider79 5 лет назад

    Greeat job!! Thank you!

  • @barungh
    @barungh 6 лет назад

    As good as always - just one line - "these method will create array from Object then we can ... " - cleared my doubt, when I saw in few places map method is used after Object.entries - it created confusion.
    Aren't these ES8 methods ?
    Thank you so much.

  • @turkialharbi2136
    @turkialharbi2136 4 года назад

    Thank you!

  • @sangrammukherjee9495
    @sangrammukherjee9495 3 года назад

    Thank you soo much

  • @chakravarthykukkala7666
    @chakravarthykukkala7666 4 года назад

    Great ExplaNATION

  • @lavanbradley9595
    @lavanbradley9595 3 года назад

    🔥🔥🔥

  • @forusanjay
    @forusanjay 3 года назад

    how to contruct an object through two different arrays one for key and another for values

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 года назад

      Basically declare an empty object and then use pretty much any kind of loop to loop through the arrays using the same index to point to the matching item from each array.
      Here is one example. Let's say the two arrays are called `keys` and `vals`.
      let obj = { };
      keys.forEach( (key, index) => {
      obj[key] = vals[index];
      });

  • @bahrametemadi2258
    @bahrametemadi2258 6 лет назад

    that was very helpful

  • @FromTheHeart-777
    @FromTheHeart-777 3 года назад

    Ty soo much!

  • @VisenyaTargaryen1
    @VisenyaTargaryen1 4 года назад

    what about searching by either key or value?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад

      What do you mean by searching? Finding things in any array can be done with a variety of methods - includes( ), find( ), indexOf( ), etc. ruclips.net/video/w84qY9peByk/видео.html

    • @VisenyaTargaryen1
      @VisenyaTargaryen1 4 года назад

      @@SteveGriffith-Prof3ssorSt3v3 got it. Meant this gishtah.medium.com/javascript-object-entries-method-47e26b4c6c58

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  4 года назад +1

      You can also look at this - ruclips.net/video/G662_abEci0/видео.html as a solution to that

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

      @@SteveGriffith-Prof3ssorSt3v3 cool! thx for the link

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

    it really helps

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

    thanks a lot