JavaScript Arrays Crash Course

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

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

  • @blueskies3336
    @blueskies3336 Год назад +251

    Where all my Odin Project peeps at man!?

  • @L-8
    @L-8 2 года назад +52

    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 10 месяцев назад

      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 4 месяца назад

      Explain to me how these things are necessary

    • @godprozee
      @godprozee 4 месяца назад +1

      @@LexxGee1234 Your sense of humor is really good

    • @LexxGee1234
      @LexxGee1234 4 месяца назад +1

      @@godprozee thanks 👍

  • @The-Athenian
    @The-Athenian Год назад +19

    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.

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

    Thanks!

  • @CreativeTutorialsWeb
    @CreativeTutorialsWeb 2 года назад +6

    Thanks so much Kyle you're awesome

  • @rohithk5234
    @rohithk5234 2 года назад +10

    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.

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

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

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

    Thanks so much, awesome video!

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

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

  • @manoj-k
    @manoj-k 2 года назад +1

    🔥🔥🔥 array methods next...

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

    perfect! i was just learning arrays!

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

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

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

    Great Arrays crash course thx from SriLanka

  • @noahtah1511
    @noahtah1511 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

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

    You really do simplify the web Thank you

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

    I am surprised to not find a single Odin project comment

  • @zl7289
    @zl7289 2 года назад +5

    That’s exactly what I need to learn recently

  • @Drelka
    @Drelka 8 месяцев назад

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

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

    Well explained. Thank you!

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

    thanks Kyle!!!

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

    Thank you for short but informational course

  • @lucky_sherpa365
    @lucky_sherpa365 4 месяца назад

    Kyle got a sick Jackson in the background bet he shreds

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

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

  • @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

  • @tenubar
    @tenubar 6 месяцев назад

    This is amazing!! thank you !

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

    Perfect timing

  • @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

  • @AnonymousCommentor_
    @AnonymousCommentor_ 5 месяцев назад

    Thanks man

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

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

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

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

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

    Thank you for your work!

  • @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

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

    Thank you for your efforts! 👏

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

    thanks my friend !

  • @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

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

    Thank you for this

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

    I like this guy

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

    Hello to TOP students. we are together into this.

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

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

  • @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

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

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

  • @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

  • @mbuguaimmanuel672
    @mbuguaimmanuel672 8 месяцев назад

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

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

    It really help

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

    Good contents!

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

    Are the JS arrays the same as Python lists?

    • @L-8
      @L-8 2 года назад

      The equivalent, at least 🤷

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

    Just perfect

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

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

  • @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!

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

    how do you type [ ] on a Mac ?

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

    Thanks mate , you making my JS journey smoooooooth.

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

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

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

      @@praisemark6971 Yep!

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

    nice

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

    Pls share link of full video

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

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

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

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

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

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

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

      It a live exstention server in visual studio code

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

      @Obes Studios yes I think it is

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

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

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

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

    👍

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

    First

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

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

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

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

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

    No legends?
    :(

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

    2:00
    **laughs in Matlab**

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

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

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

    Second

  • @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.

  • @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

  • @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🙂🙂🙂🙂🙂🙂🙂

  • @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

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

    thank you mate

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

    Second

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

    First