JavaScript Arrays Crash Course

Поділитися
Вставка
  • Опубліковано 29 гру 2024

КОМЕНТАРІ • 114

  • @L-8
    @L-8 2 роки тому +56

    It's also worth noting that "array" is not one of JavaScript's "primitive" types; arrays are just objects, unlike strings, numbers, booleans, etc. If you test "typeof anArray", you get "object". Arrays are just objects with numbers as their keys, and some cool methods (and one property).
    If we "dissect" the array ["A", "B", "C", "D"], it's basically this object -- the keys 0 to 3 and length (the methods are hidden in its prototype):
    ( { 0: "A", 1: "B", 2: "C", 3: "D", length: 4 } )[2] // "C"
    The bracket notation you use to access array elements is also just an object thing - " person.name " can be written as " person["name"] ", for example. This bracket notation can be used instead of dot notation when you want to access an object property with a key that isn't a valid JavaScript identifer - in the case of arrays, a key starting with a number - or when you want to access a property on an object unknown until runtime.

    • @talleyrand9530
      @talleyrand9530 2 роки тому +2

      Dude, nearly anything in JS is an object.
      It's true while a string for example is considered a primitive type, but you can access all of its methods inherited from the String.prototype as if it were an object
      try "str".length
      It has object properties so we deal with it as an object.

    • @L-8
      @L-8 2 роки тому

      ​@@talleyrand9530 But it's still not technically an object; it's just coerced to one behind the scenes when you read its properties. But your point that "nearly anything in JS is an object" should really be "everything" -- it's an object-oriented language after all. Object or not, though, the main point on primitives is that they can't be mutated.

    • @stanleybarbara6448
      @stanleybarbara6448 Рік тому

      this is why i came, thanks for clarifying

    • @L-8
      @L-8 Рік тому

      @@stanleybarbara6448 It wasn't the most beginner-friendly comment, admittedly, but you're welcome.

    • @Nsmp22
      @Nsmp22 Рік тому

      This perfectly explains why arrays are considered objects. None of the courses I've read actually explained this, so thank you.

  • @rishabsharma5307
    @rishabsharma5307 2 роки тому +19

    some more crash couse ideas:
    1. Typescript
    2. Web 3.0/ blockchain
    3. Your Hairstyle

    • @LexxGee1234
      @LexxGee1234 8 місяців тому

      Explain to me how these things are necessary

    • @godprozee
      @godprozee 8 місяців тому +1

      @@LexxGee1234 Your sense of humor is really good

    • @LexxGee1234
      @LexxGee1234 8 місяців тому +1

      @@godprozee thanks 👍

  • @The-Athenian
    @The-Athenian Рік тому +21

    Also, always use semicolons. He's not using any here because It's just an example and javascript understands code without them for the most part, but semicolons can help avoid mistakes.

  • @talleyrand9530
    @talleyrand9530 2 роки тому +4

    A simple tutorial at this point, but a welcome one.
    Thanks Kyle!

  • @chickenjoy
    @chickenjoy 2 роки тому +2

    I'm a new subscriber and I'm really loving these short but informational courses. Thank you for this Kyle.

  • @manoj-k
    @manoj-k 2 роки тому +1

    🔥🔥🔥 array methods next...

  • @rohithk5234
    @rohithk5234 2 роки тому +11

    Accessing elements using a[index] can sometimes cause error, using a.at(index) is much better, suppose if u wanna access last element use a[a.length-1] or much more simpler way a.at(-1). Using built in methods is much easier.
    Love your videos.

    • @farhanaditya2647
      @farhanaditya2647 2 роки тому

      Could you elaborate how exactly it can cause error? I've never encountered one. At most, it only gives a wrong element which is probably my own fault.

    • @farhanaditya2647
      @farhanaditya2647 2 роки тому +1

      Anyway, I didn't know that .at(-1) will access the last element which is pretty handy. It's pretty annoying when you have to write a[element.length - 1] especially when the variable name is quite long. Thanks!

    • @farhanaditya2647
      @farhanaditya2647 2 роки тому

      Actually, I just remembered that .at is a new feature so that explains why I never touch it before.

    • @paymankhayree8552
      @paymankhayree8552 2 роки тому +1

      .at() is not supported by IE

    • @farhanaditya2647
      @farhanaditya2647 2 роки тому +2

      @@paymankhayree8552 I think nobody cares about IE anymore.

  • @noahtah1511
    @noahtah1511 6 місяців тому +2

    what i found interesting is that the developer tools show many details about the array that you are logging to the console. that seems like something that will be useful later on

  • @CreativeTutorialsWeb
    @CreativeTutorialsWeb 2 роки тому +6

    Thanks so much Kyle you're awesome

  • @P00ters1
    @P00ters1 2 роки тому +4

    perfect! i was just learning arrays!

  • @PhoticsTV
    @PhoticsTV 2 роки тому +3

    Multidimensional arrays, impressive.
    Heh, it was nice to see one of these videos where I already understood everything, 😄

  • @Hyper_Futbuss
    @Hyper_Futbuss 2 роки тому +1

    Great Arrays crash course thx from SriLanka

  • @gmcalabr
    @gmcalabr Місяць тому +1

    woah woah woah! Hey, how'd you do that format on save thing? I get shift+option+f, I get that you can add that to the settings.json file. But I can't get it to do that bracket separation thing. It will auto-indent and auto-separate HTML main tags, but it won't do that.
    FYI, I'm talking about the thing at 4:21.

  • @reflectionethio9662
    @reflectionethio9662 2 роки тому +2

    You really do simplify the web Thank you

  • @lambertrichards
    @lambertrichards Рік тому +2

    Thanks so much, awesome video!

  • @Drelka
    @Drelka Рік тому

    Thanks for a quick reminder. Your videos are really helpful and explaination is very clear.

  • @JonatanOliver
    @JonatanOliver Рік тому

    Thank you for short but informational course

  • @paulward5452
    @paulward5452 Рік тому +2

    Thanks!

  • @Wont.r8
    @Wont.r8 21 день тому +1

    u r my hero fr

  • @zl7289
    @zl7289 2 роки тому +5

    That’s exactly what I need to learn recently

  • @marcinzale
    @marcinzale 2 роки тому +2

    Well explained. Thank you!

  • @aliemrecakmakoglu9185
    @aliemrecakmakoglu9185 2 роки тому +2

    Thank you for you video. It is amazing. However, I wondering another thing: Which app use to show your face on the right of the screen in a circle?

    • @L-8
      @L-8 2 роки тому +1

      Any video editing software lol

  • @modinateniola772
    @modinateniola772 2 роки тому

    Thank you so much for this....it came at the right time

  • @tenubar
    @tenubar 9 місяців тому

    This is amazing!! thank you !

  • @kirantechnophile7852
    @kirantechnophile7852 2 роки тому

    It's very clear. Arrays in 6mins.. can't believe it.

  • @haibaidzokwomandre1468
    @haibaidzokwomandre1468 Рік тому +1

    Hello to TOP students. we are together into this.

    • @solid_2077
      @solid_2077 19 днів тому

      crazy how there are so few comments the more I progress.

  • @chill_broskie
    @chill_broskie 2 роки тому

    Kyle got so excited about array's he hit the mic

  • @adil8132
    @adil8132 2 роки тому

    Thank you for your efforts! 👏

  • @AhmadMaartmesrini
    @AhmadMaartmesrini Рік тому

    thanks Kyle!!!

  • @chrisgk7494
    @chrisgk7494 Рік тому +2

    I am surprised to not find a single Odin project comment

  • @amirka25
    @amirka25 2 роки тому +1

    Thank you for this interesting video.
    It looks like JS is very close to Google Sheets Scripts.
    Question, how much different are they? And if I learn one, how can I know the difference (in terms of commands)?
    Thanks again

  • @thehistoryof4677
    @thehistoryof4677 2 роки тому +1

    Perfect timing

  • @CrazyCodingChannel
    @CrazyCodingChannel 2 роки тому

    Thank you for your work!

  • @samehelgazar9443
    @samehelgazar9443 2 роки тому

    ooh maaaan ,, iam studing arr since yesterday, and then u upload a video about it, what a coincidence lol ,,
    thanks for that but it would be better if its not a crash course

  • @romanpr6691
    @romanpr6691 2 роки тому +1

    How do you refresh page without click on "reload" in browser?

    • @L-8
      @L-8 2 роки тому +2

      It's a vscode extension called live server

    • @saidibrahim5931
      @saidibrahim5931 2 роки тому +1

      Ctrl + r

  • @gamerZone93722
    @gamerZone93722 Рік тому

    thanks my friend !

  • @PcHabitat
    @PcHabitat 2 роки тому

    Hello sir, do you a js and dom cheat sheets by chance?

  • @rahulsinha9766
    @rahulsinha9766 2 роки тому +2

    Why I can't make any of my web pages even after learning html css and javascript

    • @rahulsinha9766
      @rahulsinha9766 2 роки тому

      Whenever I try to write codes nothing comes in my mind

    • @chris94kennedy
      @chris94kennedy 2 роки тому

      Try to recreate a website, start with appearance (html css) and then emulate functionality in JS

  • @iftakharhussain
    @iftakharhussain 2 роки тому +1

    I really wish someone made a video on creating command palette on a website like vscode from scratch. I really hope You will make one.

    • @AlphaFrog1021
      @AlphaFrog1021 2 роки тому

      that's not an easiest thing to do you know

  • @farshidjamali
    @farshidjamali 2 роки тому +1

    Are the JS arrays the same as Python lists?

    • @L-8
      @L-8 2 роки тому

      The equivalent, at least 🤷

  • @mbuguaimmanuel672
    @mbuguaimmanuel672 Рік тому

    how can you add a single item to an empty array each time without replacing those that are already in the array ....

  • @lucky_sherpa365
    @lucky_sherpa365 8 місяців тому

    Kyle got a sick Jackson in the background bet he shreds

  • @hertechera
    @hertechera Рік тому

    Thank you for this

  • @codewithmarc3569
    @codewithmarc3569 2 роки тому

    Good contents!

  • @hrf4711
    @hrf4711 2 роки тому

    Please do a video on all loops example foreach, forin etc

  • @AnonymousCommentor_
    @AnonymousCommentor_ 8 місяців тому

    Thanks man

  • @JustinK0
    @JustinK0 2 роки тому

    What do you use to have it run live and update in the browser as you save the file?

  • @craiggazimbi
    @craiggazimbi 2 роки тому +1

    Thanks mate , you making my JS journey smoooooooth.

    • @praisemark6971
      @praisemark6971 Рік тому

      How is your first year as a software engineer.
      Just started any tips

    • @sattmowards
      @sattmowards 7 місяців тому

      @@praisemark6971 Yep!

  • @samuelrovetto6405
    @samuelrovetto6405 Рік тому

    how do you type [ ] on a Mac ?

  • @ContraHacker1337
    @ContraHacker1337 2 роки тому

    Why did I watch this video all the way through? Monke see WDS video... monke click. Neuron activation.

  • @richardlee2708
    @richardlee2708 Рік тому

    I like this guy

  • @UDOFAA
    @UDOFAA 2 роки тому

    It really help

  • @LalithSriSaiManda
    @LalithSriSaiManda 2 місяці тому +1

    Dude sounds like Fireship at 1.25x speed

  • @modinateniola772
    @modinateniola772 2 роки тому

    Pls share link of full video

  • @asherstokes575
    @asherstokes575 Рік тому

    Just perfect

  • @Oxxygen_io
    @Oxxygen_io 2 роки тому

    If you learn how arrays methods work you have learned a lot.

  • @FairyFromTheMoon
    @FairyFromTheMoon 2 роки тому

    I'm a js noob ... hence don't understand why there is no semicolon at the end of each line?

  • @KaMZaTa
    @KaMZaTa 2 роки тому

    @Web Dev Simplified @Kyle - Please please please! Make some tutorials about React and NodeJS SEO optimization! To me it's a really mess!

  • @diesunddas405
    @diesunddas405 2 роки тому

    Will we ever see Kyle playing a metallica song on this guitar?

  • @premsingh6967
    @premsingh6967 2 роки тому

    nice

  • @daljeetsingh5127
    @daljeetsingh5127 2 роки тому

  • @jehadnasereddin7755
    @jehadnasereddin7755 2 роки тому

    2:00
    **laughs in Matlab**

  • @Randomguy48279xyz
    @Randomguy48279xyz 2 роки тому

    👍

  • @Gaius_Julius_Caesar_Augustus
    @Gaius_Julius_Caesar_Augustus 2 роки тому +2

    First

  • @safwanu2be
    @safwanu2be 2 роки тому

    Hi bro
    Nice videos
    മലയാളി
    ಕನ್ನಡಿಗಾಸ್

  • @fernandobarros1911
    @fernandobarros1911 2 роки тому

    No legends?
    :(

  • @luke43credici73
    @luke43credici73 Рік тому

    Ngl at first i got a bit confused at the end of the video

  • @vishnuvirat2501
    @vishnuvirat2501 2 роки тому +2

    Expecting Full react course and Javascript course for free❤️❤️❤️

    • @Binyamin1444
      @Binyamin1444 2 роки тому +1

      No, They're worth paying for. I bought both his JS courses and about to buy his React course.

    • @vishnuvirat2501
      @vishnuvirat2501 2 роки тому

      @@Binyamin1444 I am from India. When we convert to dollers to rupees, it costs heavy.

  • @chris94kennedy
    @chris94kennedy 2 роки тому +2

    Hi Kyle - please would you consider doing Python videos? Thank you for your content.

  • @ReyBanYAHUAH
    @ReyBanYAHUAH 2 роки тому

    Always remember we must repent of our sins (sin is transgression The Law Of Yahuah The Father in Heaven. The Law are The Books: Genesis, Exodus, Leviticus, Numbers, & Deuteronomy). We must repent of our sins and Have Belief On Yahusha The Messiah. HE Died and Rose three days later so that we can be forgiven of our sins!
    Come to HIM🙂🙂🙂🙂🙂🙂🙂

  • @Gaius_Julius_Caesar_Augustus
    @Gaius_Julius_Caesar_Augustus 2 роки тому

    Second

  • @hiddenLadder
    @hiddenLadder 2 роки тому +1

    is that all?? lol

    • @L-8
      @L-8 2 роки тому

      Nope 😃 There's a whole rabbit hole of array methods.

    • @hiddenLadder
      @hiddenLadder 2 роки тому

      @@L-8 yeah i know that i just thought that i could learn something new for myself

  • @jesuschristsaves1955
    @jesuschristsaves1955 2 роки тому

    And saying, The time is fulfilled, and the kingdom of God is at hand: repent ye, and believe the gospel.
    - Mark 1:15 KJV
    The Gospel aka the Good News
    Moreover, brethren, I declare unto you the gospel which I preached unto you, which also ye have received, and wherein ye stand; 2 By which also ye are saved, if ye keep in memory what I preached unto you, unless ye have believed in vain. 3 For I delivered unto you first of all that which I also received, how that Christ died for our sins according to the scriptures; 4 And that he was buried, and that he rose again the third day according to the scriptures:
    - 1 Corinthians 15: 1-4 KJV
    For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.
    - John 3:16 KJV
    That if thou shalt confess with thy mouth the Lord Jesus, and shalt believe in thine heart that God hath raised him from the dead, thou shalt be saved. 10 For with the heart man believeth unto righteousness; and with the mouth confession is made unto salvation. 11 For the scripture saith, Whosoever believeth on him shall not be ashamed.
    - Romans 10:9-11 KJV
    For whosoever shall call upon the name of the Lord shall be saved.
    - Romans 10:13 KJV
    Jesus saith unto him, I am the way, the truth, and the life: no man cometh unto the Father, but by me.
    - John 14:6 KJV
    He that believeth on the Son hath everlasting life: and he that believeth not the Son shall not see life; but the wrath of God abideth on him.
    - John 3:36 KJV

  • @JesusPineda-ut9hs
    @JesusPineda-ut9hs 2 місяці тому

    Coments.push("I am comming from Odin Project");

  • @bedribulut
    @bedribulut Рік тому

    thank you mate

  • @aapohanhisalo5137
    @aapohanhisalo5137 2 роки тому

    First

  • @atikur129
    @atikur129 2 роки тому

    Second