An Encounter with JavaScript Objects

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 208

  • @Fireship
    @Fireship  5 ปีที่แล้ว +368

    Let's just pretend the audio issues in this video were meant to add extra suspense 👻 ¯\_(ツ)_/¯

    • @vasiovasio
      @vasiovasio 5 ปีที่แล้ว +5

      One question - what is the editor and theme that you use in your videos? Looks like Visual Studio Code with Material theme?

    • @Fireship
      @Fireship  5 ปีที่แล้ว +23

      @@vasiovasio VS Code + Atom One Dark + vscode-icons

    • @911madza
      @911madza 5 ปีที่แล้ว +4

      @@Fireship hands down Atom had the most beautiful UI, tho VS Code is light years ahead when it comes to performance and features... to be honest, I still miss the smooth look and feel of Atom (One Dark theme don't fully recreate that), but in nowadays rush you have to go with what's best for productivity...

    • @jiandeng8595
      @jiandeng8595 5 ปีที่แล้ว +2

      another qutestion, how to quick type the emoji string, i had to use the short ctrl+shift+b (Windows) and select one from the list

    • @chromus9149
      @chromus9149 3 ปีที่แล้ว +1

      What plugins do you use to get the squares on the left side and the console.log showing its output on the right?

  • @gospodarsile4606
    @gospodarsile4606 5 ปีที่แล้ว +343

    Let's be honest. There is no better programming content than FireShip. A big thank you! I hope you never stop making videos.

    • @jaimerojas6578
      @jaimerojas6578 5 ปีที่แล้ว +1

      Yeah I just love the format of the videos!

    • @WTFAnyNameWorks
      @WTFAnyNameWorks 3 ปีที่แล้ว

      Truer words have never been spoken!

    • @ar7alamin842
      @ar7alamin842 2 ปีที่แล้ว

      Kkkkkokkokkkokokkokk

    • @ar7alamin842
      @ar7alamin842 2 ปีที่แล้ว

      @@WTFAnyNameWorks kkokkkkokokokokkok

    • @ar7alamin842
      @ar7alamin842 2 ปีที่แล้ว

      kkokkkkkkk

  • @tobeqz7065
    @tobeqz7065 5 ปีที่แล้ว +133

    This course is PERFECT for people with some programming background who need to learn JS quickly. Thank you so much for creating it. Thanks to you I've slowly started to fall in love with JS and I'm using it for more and more of my projects.

    • @FordExplorer-rm6ew
      @FordExplorer-rm6ew 5 ปีที่แล้ว +16

      Or for dumb people like me who need to review this over and over

    • @wchorski
      @wchorski 3 ปีที่แล้ว +1

      @@FordExplorer-rm6ew 🙃

    • @whatisiswhatable
      @whatisiswhatable ปีที่แล้ว

      Really? I know JS pretty well but this stuff moves too fast and doesn't give anyone time to digest. It's REALLY well done and covers everything right but I'm not sure I'd recommend it

  • @harshitvarma7867
    @harshitvarma7867 ปีที่แล้ว +2

    If someone did not understand 8:03 here is a quick explanation,
    it just means that in case of nested objects, example:
    let obj = {
    name: "John",
    anotherObject: { age: 52, }
    }
    -> if we Object.assign({}, ) this object to let say b, although it wont copy the properties of 'obj' through reference, lets call it hard copying, it will copy the properties inside the nested object (anotherObject here) through reference.
    means, changing the properties of nested objects will change the copied properties of b.

  • @LukeyDubs
    @LukeyDubs 5 ปีที่แล้ว +4

    I love the blend of high level concepts and basics. It’s not overwhelming, and it’s not too basic. Amazing content

  • @mabdullahsari
    @mabdullahsari 5 ปีที่แล้ว +55

    09:40 defining the eatBrain property on the new zombie object itself means that a brand new function is going to be created every time a new zombie is created. Better to set it on the function's prototype property so it is only declared once. Also, that is what happens behind the scenes when you use the class syntactic sugar.
    Great video!

    • @Fireship
      @Fireship  5 ปีที่แล้ว +26

      That is a great point. I've been spoiled by TypeScript for a long time.

    • @davidjunghan91
      @davidjunghan91 4 ปีที่แล้ว +1

      duh, it's amazing

    • @TheCecchino98
      @TheCecchino98 3 ปีที่แล้ว +3

      sorry if i don't get it, but could you give an example of how to achieve that? From my understanding, by "function's prototype" you are referring to the constructor function (Zombie), and i'm having a hard time understanding how to access the prototype from there.

    • @mabdullahsari
      @mabdullahsari 3 ปีที่แล้ว +2

      @@TheCecchino98After having declared and assigned the constructor
      👇
      Zombie.prototype.eatBrain = function() {};
      So, *outside* the constructor.

    • @TheCecchino98
      @TheCecchino98 3 ปีที่แล้ว

      @@mabdullahsari thank you very much!

  • @tytywuu
    @tytywuu 3 ปีที่แล้ว

    I came from a Python background and finally understand the mysterious rationale of copy and deepcopy of dictionaries. Thank you!

  • @CaptTragedy
    @CaptTragedy 2 ปีที่แล้ว +2

    First of all I know the editing for this video probably took forever, especially finding old clips that fit the theme so thank you for that, but also your tutorials (albeit very short and fast) have been very helpful for someone like me who just graduated from a bootcamp( I know...) so thank you for the hard work!

  • @agustincisneros6725
    @agustincisneros6725 5 ปีที่แล้ว +2

    This course is really good. You're explaining topics that are really complicated to understand because it's necessary to see the javascript history and it's hard to do. Thank you!

  • @theskyspire
    @theskyspire 5 ปีที่แล้ว

    I think I need to watch this at least 10 times to fully absorb the density of the content. Other videos it is common to speed playback to 1.5X , this is one video where slowing it down can actually be helpful.. refreshingly concise, great job.

  • @marcusgallegos8384
    @marcusgallegos8384 5 ปีที่แล้ว +13

    This was very well produced. You Hit a lot of deep CS topics in a digestible high level way. Sharing this with my team!

  • @TheRyanSmee
    @TheRyanSmee 5 ปีที่แล้ว +22

    this it great. popping sound made me jump though ha

    • @Fireship
      @Fireship  5 ปีที่แล้ว +1

      Sorry bout that, YT did not like the audio for some reason

  • @tropicaljupiter
    @tropicaljupiter 3 ปีที่แล้ว +1

    The key to getting this video is to pause it, try the shit out in vscode, and go "ohhhh"

  • @roshanjose7692
    @roshanjose7692 ปีที่แล้ว

    You and theo are my fav tech content creators

  • @eshaan7_
    @eshaan7_ 4 ปีที่แล้ว

    I spent 4 hours parsing/escaping a JSON file, because a particular library kept rejecting it. Then when it finally worked, I used another library. And people say frontend dev is easy :)

  • @troythompson2
    @troythompson2 5 ปีที่แล้ว +8

    I learned A LOT in this one. This channel is so clutch.

  • @hughesd.mungus9819
    @hughesd.mungus9819 5 ปีที่แล้ว

    I only ever used Javascript to make a small project for school and I mostly disliked the language. This tutorial made me appreciate the language a bit and I am just astounded at how you can make a programming tutorial so fun and interesting. I just have to say thank you and keep doing what you're doing man!

  • @pokefreak2112
    @pokefreak2112 5 ปีที่แล้ว +4

    Love how in depth these videos go, I had personally never heard of the object.entries destructuring trick before!

  • @عبدالرزاقالوزغي
    @عبدالرزاقالوزغي 7 หลายเดือนก่อน

    I can't believe that it's it's it's juuuuuuuust 10 min I'm like WOW, Thank you so much 💖

  • @MongooseTacticool
    @MongooseTacticool 3 ปีที่แล้ว

    As a beginner, I'm so glad I found this channel :D

  • @n.i.c
    @n.i.c 5 ปีที่แล้ว +3

    You just blew my mind. I've never heard of Bigint before 🤯

    • @Fireship
      @Fireship  5 ปีที่แล้ว +1

      Bigint was the highlight of the video!

  • @piyushchoughule5383
    @piyushchoughule5383 5 ปีที่แล้ว

    10 min video and hours worth of content. Thank you so much.

  • @ProgrammingwithPeter
    @ProgrammingwithPeter 5 ปีที่แล้ว +4

    When I get notification from this channel, I know that I'm getting quality!

  • @adityashinde3864
    @adityashinde3864 5 ปีที่แล้ว

    I like your teaching style . please make more JavaScript video like this one.

  • @YashGupta-dr5re
    @YashGupta-dr5re 5 ปีที่แล้ว +22

    9:53
    const obj = new Zombie("👨‍💻 Jeff");
    🤣🤣🤣

  • @DivineZeal
    @DivineZeal 5 ปีที่แล้ว

    With programming there are a million ways to do something, love it. Great video, learned some new tricks!

  • @arturomedina2055
    @arturomedina2055 4 ปีที่แล้ว +2

    What's the extension he's using here to print those console.log() ?

  • @arch7143
    @arch7143 4 ปีที่แล้ว

    And that was perfect scene/phrase to end this!

  • @valcron-1000
    @valcron-1000 5 ปีที่แล้ว

    Another amazing technical video about JavaScript

  • @shriniwasrocks
    @shriniwasrocks 5 ปีที่แล้ว

    OMG Object.entries will make my life easier to deep check an object. Amazing! Thanks man!

    • @xTiQ
      @xTiQ 5 ปีที่แล้ว

      But you need to use a polyfill to make it work in IE. It's a new browser thing.

  • @rahulgharde7603
    @rahulgharde7603 5 ปีที่แล้ว

    good one. objects are the origin on JS

  • @yash3827
    @yash3827 5 ปีที่แล้ว +1

    Ultra use of object

  • @DiwashHCR2
    @DiwashHCR2 ปีที่แล้ว

    The video I needed to watch .. thanks

  • @sojumoscow
    @sojumoscow 2 ปีที่แล้ว +1

    After watching this especially the last part, I am confused, so can I use function instead of a class? (Currently i dont know class)

  • @YinonOved
    @YinonOved 5 ปีที่แล้ว

    thought I was in control of this topic...🤓 thanks for this refresher and sharpening

  • @dantech2011
    @dantech2011 5 ปีที่แล้ว

    Please do more of these videos! Thanks @Fireship

  • @NikhilKumar-yn6jf
    @NikhilKumar-yn6jf 5 ปีที่แล้ว +11

    Are we an object ?
    #Existential101

    • @Fireship
      @Fireship  5 ปีที่แล้ว +10

      Or are we a primitive?

    • @moonythm
      @moonythm 5 ปีที่แล้ว +12

      @@Fireship we are a wrapper around a primitive

    • @Fireship
      @Fireship  5 ปีที่แล้ว +5

      @@moonythm Deep, i like that!

  • @onee
    @onee ปีที่แล้ว +1

    4:01 This gives an error that says "Cannot redeclare block-scoped variable 'spider'." and "Cannot redeclare block-scoped variable 'legs'."

  • @iliashterev38
    @iliashterev38 3 ปีที่แล้ว +1

    The tempo is so fast, I can't even hit pause on time to get some rest and rethink it.

  • @Fatfit2
    @Fatfit2 5 ปีที่แล้ว +6

    I don't think I've ever laughed while understanding Javascript more intimately at the same time...
    Twilight Zone is legit a great show btw...

  • @edwardrhodes1518
    @edwardrhodes1518 5 ปีที่แล้ว

    You unlock this door with the key of imagination - yep, thanks for providing the door

  • @Kawaiiization
    @Kawaiiization 5 ปีที่แล้ว +1

    Love it!
    Love it!
    Love it!
    Fast pace for the win mate!

  • @nagakrushnay4254
    @nagakrushnay4254 5 ปีที่แล้ว +2

    Which plugin you are using for getting console log outputs in ide ?
    Good video

    • @tartarus1322
      @tartarus1322 5 ปีที่แล้ว

      I second that

    • @bgpratheep
      @bgpratheep 5 ปีที่แล้ว

      I too want to know that....

  • @mhytos420
    @mhytos420 ปีที่แล้ว

    dude, you are saving my ass rn. Thank you!

  • @xeonblue007
    @xeonblue007 5 ปีที่แล้ว

    This is a really awesome channel period.

  • @ChumX100
    @ChumX100 5 ปีที่แล้ว +1

    Well that escalated quickly...

  • @tomascarignano5002
    @tomascarignano5002 3 ปีที่แล้ว

    Jeff kudos to you man! You always make learning fun with all these creative jokes. Thanks a lot

  • @klutch4198
    @klutch4198 3 ปีที่แล้ว

    Still one of the best! 🔥🔥🔥

  • @Ndzzle
    @Ndzzle 5 ปีที่แล้ว

    First time I've actually slowed a video down just go catch all the content haha

  • @sourishdutta9600
    @sourishdutta9600 5 ปีที่แล้ว

    Classic one cover almost everything, Thanks 😊. I just wanted to request you for something like if it is possible then please make a video on Symbol in es6 and their use case in real time application like where it's suitable for use and in enterprise application how we can maintain this. Thank you much
    . Big fan of yours.

  • @gunasekarant6498
    @gunasekarant6498 5 ปีที่แล้ว

    Covered overall all the concepts 😍

  • @reymarkandog1441
    @reymarkandog1441 4 ปีที่แล้ว

    What text editor are you using? Or what extension you used for those icons between the ' ' ?

  • @sonamshrishmagar6035
    @sonamshrishmagar6035 3 ปีที่แล้ว

    u know that fireship 10min video is actually 30 min video. It just runs for 10 min.

  • @abdulelahaljeffery6234
    @abdulelahaljeffery6234 5 ปีที่แล้ว

    concise, elegant, and tremendously informative ❤️

  • @YinonOved
    @YinonOved 5 ปีที่แล้ว

    Jeff what are these Emojis you use in your code? doesn't look typical

  • @Ryu53898
    @Ryu53898 5 ปีที่แล้ว +1

    So you stopped using Monokai pro ?

  • @yauul
    @yauul 5 ปีที่แล้ว +2

    Someone seems to be excited for Halloween

  • @nick.h7566
    @nick.h7566 2 ปีที่แล้ว

    Gleasons map, noice!

  • @ShounenKaze
    @ShounenKaze 4 ปีที่แล้ว

    How do you have those cool icons in your code, like the trex and comet?

  • @gyohza
    @gyohza 5 ปีที่แล้ว +1

    One thing that bothers me is - why can't we have higher order functions, like in arrays, but for objects, since they are basically associative arrays?
    Having programmed PHP for a while, I'm quite bummed out that we can't use .map(), .filter() and .reduce() on them.

    • @Fireship
      @Fireship  5 ปีที่แล้ว +2

      I've always felt the same way - would be super convenient. I assume they are missing because the Object is so fundamental to the language. You can use the `Map` class as an alternative.

    • @gyohza
      @gyohza 5 ปีที่แล้ว

      For the sake of simplicity, I usually stick with for...in loops - not very happy about it, but also not very disappointed.
      We can get by, but it doesn't feel right to just go switching paradigms (although I know PHP isn't really a good example of paradigm consistency).

  • @sagnikpradhan3594
    @sagnikpradhan3594 5 ปีที่แล้ว

    I really love the quality man! Good Work 👌

  • @vamshidharreddy5920
    @vamshidharreddy5920 3 ปีที่แล้ว

    The only reason I'm sticking to angular is fireship.

  • @favouroyende1111
    @favouroyende1111 6 หลายเดือนก่อน

    Thank you so much!

  • @SahilKashyap64
    @SahilKashyap64 5 ปีที่แล้ว

    How do you make your videos they are so elegent. Your channel content quality is awesome. It looks like vscode editor and probably some emoji extension. What is the font size?

  • @palachokrab5711
    @palachokrab5711 3 ปีที่แล้ว

    Amazing content..

  • @kunalpandey7189
    @kunalpandey7189 3 ปีที่แล้ว

    RIGHT SIDE WINS

  • @jazzz4988
    @jazzz4988 2 ปีที่แล้ว

    Fireship, could you please link me to the sound effect/music that plays from 0:15 to 0:25? That spacey, wide sounding music with some harp plucks? Thanks!
    (Also this video helped me a lot as a Javascript student)

  • @polyshrub
    @polyshrub 4 ปีที่แล้ว

    Dang you have a lot of knowlage about javascript where did you learn all this I expect that you've probably been working with it for more then 10 years?

  • @zaturntarto3814
    @zaturntarto3814 3 ปีที่แล้ว

    Are you just using the "CTRL+Z" throughout the video or its video editing ?

  • @tonysmarks3578
    @tonysmarks3578 5 ปีที่แล้ว

    Love this video but not the odd part of that

  • @peopledrivemecrazy
    @peopledrivemecrazy 5 ปีที่แล้ว

    Right side wins, sneaky pun ;)

    • @Fireship
      @Fireship  5 ปีที่แล้ว +1

      No pun intended ;)

  • @slavamelanko5992
    @slavamelanko5992 5 ปีที่แล้ว

    Perfect tutorial 👌🏼

  • @augusto256
    @augusto256 5 ปีที่แล้ว

    Actually all fuctions are methods derived from the primary document object.

    • @nicholasmaniccia1005
      @nicholasmaniccia1005 5 ปีที่แล้ว

      I thought functions inherited from the object prototype and everything you put between its curly braces is a property that gets fed to the JS interpreter when you call that function, or use the parentheses short hand.

    • @augusto256
      @augusto256 5 ปีที่แล้ว +1

      @@nicholasmaniccia1005 Yes, it´s like that

  • @JoeWong81
    @JoeWong81 5 ปีที่แล้ว

    That was a great video thanks

  • @joaomelo6642
    @joaomelo6642 5 ปีที่แล้ว

    tks for the awesome content

  • @oskar-petr
    @oskar-petr 3 ปีที่แล้ว +1

    Hi, whats the extension that you use in VS code that outputs the value from console.log next to it?

    • @ChaoticNeutralMatt
      @ChaoticNeutralMatt 3 ปีที่แล้ว

      Sadly I've been combing multiple videos and comments for the answer to this question.

    • @joaogc
      @joaogc 3 ปีที่แล้ว

      Quokka.js

  • @jayanths1221
    @jayanths1221 5 ปีที่แล้ว +1

    Okay, I have a doubt.
    let web = ''outer';
    function foo() {
    let web = 'inner';
    let in = () =>
    console.log(this.web);
    }
    }
    What will the code print? 'outer' or 'inner'?

    • @lot.bajrami
      @lot.bajrami 5 ปีที่แล้ว

      Inner, but if you do it with arrow function it will print outter

    • @jayanths1221
      @jayanths1221 5 ปีที่แล้ว

      @@lot.bajrami Sorry, I meant to use arrow function over there.

    • @jayanths1221
      @jayanths1221 5 ปีที่แล้ว +1

      @@lot.bajrami But isn't inner outside of the function and hence global for that function? Why would arrow function print outer?

    • @khaleddd
      @khaleddd 5 ปีที่แล้ว

      @@jayanths1221 Because arrow functions have no context, they take their parent's

  • @dasdunetechnologies1695
    @dasdunetechnologies1695 5 ปีที่แล้ว

    nice video, as vintage clips try some from the invaders tv serie !

  • @luis96xd
    @luis96xd 4 ปีที่แล้ว

    This was an excellent video! 😄 Great Quality!
    What if I came from Java and C# and I have and array of objects:
    clients[i] = new Client(name, lastName, phoneNumber);
    And I want to create a new object and assign its properties. How would it be in Javascript?
    And if I have other object which gets data of each client object. How would it be in Javascript? Because I'm getting problem getting property values from other objects

  • @metasavagex
    @metasavagex 4 ปีที่แล้ว

    Fireship is King

  • @alekseysoldatenkov5675
    @alekseysoldatenkov5675 5 ปีที่แล้ว

    Seeing destructuring in the for...of loop, was my twilight zone moment.
    Whats the outro track dawg?

  • @abdelkadermh
    @abdelkadermh 5 ปีที่แล้ว

    Thank you for the good content you're making!

  • @tomershechner
    @tomershechner 5 ปีที่แล้ว

    OMG. I FUCKING LOVE YOUR VIDEOS M8. SO UNDERRATED.

  • @911madza
    @911madza 5 ปีที่แล้ว +37

    #1 rule to avoid to be a gentleman:
    const women = new Women();

    • @KangJangkrik
      @KangJangkrik 4 ปีที่แล้ว

      Object.defineProperty(window, 'women', {
      value: new Women(),
      writable: false
      });
      Check. ♟️

  • @vinceramces
    @vinceramces 5 ปีที่แล้ว

    How about null/undefine checking in objects?
    You don't want a code that something like this
    const data = response.data.item ? response.data.item: response.data

    • @Fireship
      @Fireship  5 ปีที่แล้ว

      We should see this null aware operator in future JS, similar to Dart github.com/tc39/proposal-nullish-coalescing

  • @JohnDoe-fe3zw
    @JohnDoe-fe3zw 5 ปีที่แล้ว

    That was a great video

  • @timelimitexceeded0
    @timelimitexceeded0 2 ปีที่แล้ว

    When I watch fireship tutorials, I feel like there's virus on my phone that puts random short videos in the middle of tutorials.

  • @pladimir_vutin
    @pladimir_vutin 5 ปีที่แล้ว

    nicee. very helpful and very nice intro and music...
    btw what's your ide?

  • @chawker67
    @chawker67 5 ปีที่แล้ว

    In 9:40 shouldn't the method be defined on the prototype?

  • @giancarloandrebravoabanto7091
    @giancarloandrebravoabanto7091 5 ปีที่แล้ว

    damn the only thing I've learned from this video is the spread notation.

  • @edumorlom
    @edumorlom 4 ปีที่แล้ว

    what is the extension that displays the return as a comment on the right side called

  • @TimeoutMegagameplays
    @TimeoutMegagameplays 5 ปีที่แล้ว +2

    Are js objects like classes in other languages?

    • @Thatguy-rh5ls
      @Thatguy-rh5ls 5 ปีที่แล้ว

      He said it was like maps in other languages. You can create classes with the class keyword.

    • @TimeoutMegagameplays
      @TimeoutMegagameplays 5 ปีที่แล้ว

      @@Thatguy-rh5ls What I don't understand is how can you set up functionsgetters/setters inside an object, to me that's the specific definition for a class not a map.

    • @Thatguy-rh5ls
      @Thatguy-rh5ls 5 ปีที่แล้ว

      @@TimeoutMegagameplays I think it's because they treat everything like it's an object. Like you can pass functions as an argument in JavaScript.

    • @Thatguy-rh5ls
      @Thatguy-rh5ls 5 ปีที่แล้ว

      Like:
      function operation(func, a, b)
      {
      console.log(func(a,b));
      }
      function sum(a,b)
      {
      return a + b;
      }
      operation(sum, 1, 2);
      This prints 3 and would work for a lot of operations like subtraction or concatenation. It works because we can pass that function as an argument.

    • @Thatguy-rh5ls
      @Thatguy-rh5ls 5 ปีที่แล้ว

      So considering this I think having a function as a property would still make it a map even though it's really weird 😅 Also, the classes in JavaScript are apparently not entirely the same as classes in other languages.

  • @sarthakdalabehera3664
    @sarthakdalabehera3664 4 ปีที่แล้ว

    May I know the ending music?

  • @OfficialNattyOrNot
    @OfficialNattyOrNot 2 ปีที่แล้ว

    What is the plugin you are using that logs the console.log() inside of the IDE?

  • @archeron3004
    @archeron3004 ปีที่แล้ว

    thank you

  • @landonlunsford2655
    @landonlunsford2655 ปีที่แล้ว

    Hey the azimuthal equidistant map, Are you a fellow flatty @Fireship? x ]

  • @zemariagp
    @zemariagp 3 ปีที่แล้ว

    This is da bomb

  • @RanjanKumar-ht7dp
    @RanjanKumar-ht7dp 5 ปีที่แล้ว

    Which editor you are using.
    I am interested in output as you type, it appears.

    • @getmorpheeus
      @getmorpheeus 5 ปีที่แล้ว

      I think he is using quokkajs

  • @RoughSubset
    @RoughSubset 5 ปีที่แล้ว

    How do you get the emojis in you editor?

  • @AdityaGupta-im9lu
    @AdityaGupta-im9lu ปีที่แล้ว

    Outro Music 🔥, please give me the name.