13: What are JavaScript Properties and Methods | Properties and Methods | JavaScript Tutorial

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024
  • What are JavaScript Properties and Methods | Properties and Methods | JavaScript Tutorial. In this JavaScript tutorial you will learn about properties and methods used on JavaScript objects. Examples of objects include variables and arrays, which are used often in JavaScript scripts.
    List of all properties: developer.mozi...
    List of all methods: developer.mozi...
    ➤ GET ACCESS TO MY LESSON MATERIAL HERE!
    First of all, thank you for all the support you have given me!
    I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!
    I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.
    I hope you will find it helpful :)
    Material for this lesson: / lesson-material-42361704

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

  • @callum6486
    @callum6486 4 года назад +20

    As soon as i saw the thumbnail i though "Elon Musk is going to teach me Properties and Methods"

  • @zalodias123
    @zalodias123 4 года назад +14

    Never thought about methods being built-in functions! Interesting perspective.

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

      I really like this take on it as well. Helps me understand methods more and how they’re different from functions.

  • @WanderingNasi
    @WanderingNasi 3 года назад +5

    Fun fact: the spacing or capitalization of the second word, like the ones used in methods, is called "Camel Casing" since the camel's hump is taller than its head.

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

      thx for information

  • @linnealinberg251
    @linnealinberg251 4 года назад +5

    var item = ["Bottle", 4, true];
    items.push("Juice");
    console.log(item.push("Juice"));
    could someone please let me know why will this result in 5? How is that counted?

    • @meliodass6951
      @meliodass6951 4 года назад +5

      by adding juice inside console log he actually added another "juice" so total amount to 5 indexes , if you were to delete 2nd one then it will count as 4; hope u understand.

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

      @@meliodass6951 Thank you, I also didn't understand the '5'.

    • @RatneshKumar-xv3gr
      @RatneshKumar-xv3gr 2 года назад

      5 is length of the list

    • @RatneshKumar-xv3gr
      @RatneshKumar-xv3gr 2 года назад

      While indexing it count form 0

  • @ShinjuiroX
    @ShinjuiroX 4 года назад +9

    I was learning JS using some bootcamp tutorial videos and had to finish assingments. Unfortunately those videos provided much less info than you need to know for completing their assignments and it was a real struggle to complete them with lack of information. Your way of explaining stuff is truly awesome. I understand these concepts much better now thanks to your tutorial. You explain everything really detailed. You have a talent for teaching.
    Thanks for these tutorial videos. Cheers!

  • @toobaadil6497
    @toobaadil6497 5 лет назад +11

    You are really great! I love the way you teach!

  • @trivedidhaval9444
    @trivedidhaval9444 6 лет назад +9

    Love your videos.. These videos helps me alot.. Thank you

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

    But Daniel, i don't understand i've thought a lot about it and i just can't figured out. How is "juice" in the 5th position if there was 4 item inserted. i've try it my self and i've got same result (5). but the length property still says 4. why is that?
    thank you for the course it is very good

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

      It is because we always start counting at 0 in programming. 🙂 So instead of 1, 2, 3, 4.... It's 0, 1, 2, 3. We call these numbers the "index", which is kinda like the "position".
      The reason we get "4" as the result when we use .length, is because it is counting the number of entries, and not the index.
      Hope this helped. 🙂

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

      @@Dani_Krossing thanks Dani but i'm afraid i still don't quite understand why isn't "juice" at the 4th position instead of 5th. you pushed in an item, this item is meant to be st third podition regarding index but the length shoun't be 4?.
      i'm quite aware that i'm the problem here. omg i just can't figure out what is that i'm missing. 🤔
      I appreciate your response Daniel, i'll study harder

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

    u deserve more viewers and subscscscribersoto THANks for epicccccccccccccc Teaching ;)

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

    Thank you my friend, it's very helpful.

  • @ashishaventador6142
    @ashishaventador6142 5 лет назад +3

    How come the precision index of juice showed 5 ? Should have been 3 isn’t it ? Please can you explain me the last part

    • @saputodude
      @saputodude 5 лет назад +4

      I thought the same thing. If you just do items.push("Juice") followed by console.log(items.push()); it will give you 4 indices ["Bottle, 4, true, "Juice"]. If you include ("Juice") within the console to push that item, it seems like it pushes it twice, giving you 5 indices instead of 4. I'm new to this, so that's what it seems like to me....

    • @ashishaventador6142
      @ashishaventador6142 5 лет назад +1

      I also thought the same, gave the same explanation to myself and continued with the course.

    • @Alluriah
      @Alluriah 5 лет назад +1

      "The push() method adds new items to the end of an array, and returns the new length." so when he wrote items.push("Juice") it added "Juice" and returned the new length which is 4, same would have happened if he wrote instead console.log(items.push("Juice")), would have returned 4, however, he wrote console.log(items.push("Juice")) after items.push("Juice")which means juice was added once and returned array length 4 and then again and returned length 5.

  • @siten1
    @siten1 10 месяцев назад +1

    How can indexOf not also be defined as a property if its "job" is to tell you the position of where certain characters are just how .length also just tells you the length of the variable.
    Are they not just, both essentially, telling you something about our variable? Thank you!

    • @aishahcarana-masiroh6691
      @aishahcarana-masiroh6691 10 месяцев назад +1

      I’ll do my best to explain.
      The difference between methods and properties in JavaScript boil down to two simple ideas: methods are dynamic, properties are static.
      I’ll expand. Methods perform operations / actions on values, hence the term ‘dynamic’. In the case of indexOf() - it is not merely telling you the position of a character, it actively scans and searches the string of characters given the arguments its fed: indexOf(‘of’), with ‘of’ being the argument given, and returns the position of the string. This argument (‘of’) can be changed to a different word to find a different position in the string. It’s interactive and changing, accepting different inputs and performing unique scans / searches each time the argument is changed.
      On the other hand, properties are static - meaning they do not perform actions or operations. Properties, as its name suggests, can be viewed as the inherent characteristics, features, or attributes of an object. Properties store or represent information of an object. Properties give us access to information, rather than perform computational actions that return a result. In the case of .length, the information it represents (provides access to) is the length of characters: a characteristic of the string.
      Hope this helps.

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

      @@aishahcarana-masiroh6691
      Thank you for the explanation but length is still performing the action of counting how many characters it has in one way or another, no?
      I was thinking the same analogy but thinking about finding the length of something is also an "action" broke it.
      How I ended up viewing it, which has not broken yet, is that
      Properties : Look at the element as a whole, while
      Methods : Can look at the individual elements of that element
      Hopefully I make sense too lol

  • @thebeardedcoder
    @thebeardedcoder 6 лет назад +3

    Excellent. All of your lessons. That dog's breathing though. LoL

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

    Great explanation!! thank you!:-) now I catch the differences

  • @bitmammothOG
    @bitmammothOG 6 лет назад +10

    Yes he's back! :D

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

    When i entered item.length
    ["Botle of water"]
    👆
    For this instead of blah blah i got 1
    Then i entered
    console.log(item.indexOf("of"));
    Instead of 7 i got -1
    And when is did
    console.log(item.replace("water", "juice"));
    🤥its telling item.replace is not a function

  • @jonathancarter2347
    @jonathancarter2347 5 лет назад +1

    I thumbs up every vid and will suggest you to other coders I come across. Great stuff!

  • @zulfiqar7967
    @zulfiqar7967 6 лет назад +2

    We need the complete Javascript and Jquery tutorials

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

    Loved it, I was stuck in this subject since yesterday and your video made it super easy, FYI your links on the video are expired

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

    Thanks a lot! That was helpful spotting the difference!

  • @lumennganje2721
    @lumennganje2721 5 лет назад +1

    how come this channel has only 155k subscribers. Should have more. In fact it will have 3M by the end of the year in Jesus' name Amen.

    • @superreverbfreak
      @superreverbfreak 5 лет назад +1

      Lumen Nganje you honestly think that works? 🙄

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

    deserves KUDOS someone finally explaining methods and objects using code, without cats or dogs

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

    *Dani Krossing* where can I finde your RUclips videos about methods and more in JavaScript ? some one send me the link please

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

    hope you have a Vue series soon if u use that framework. love all your vids

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

    Very helpful video. Thank you so much :)

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

    sir how to make full website in html and css please post one video of full website making

  • @lucyzteinn
    @lucyzteinn 5 лет назад +3

    this lesson is just perfect

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

    We have one teacher that teach us java and he is idiot.. from then i dont want to do it but from when i discovered you i want to make everything

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

    i love u!! thanks for explaining properly what a method is

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

    Just wanted to thank you for explaining it for a newbie

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

    Niiice Thank U

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

    Thank you so much

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

    Thanks a million

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

    good tutorial!, i realise the programming languages use similar methods, just in different syntax, easy to understand after learning python

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

    Thank u so much for this great videos ❤️

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

    Huge props from Israel, great great channel !!

  • @2vagner
    @2vagner 4 года назад

    Excellent

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

    Great. Thanks for the lists, too!

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

    THANKS

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

    Very helpful! Just wondering why the Push one at end showed up as 5 for length, I thought it’d be 3?

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

    really helpful, thanks!

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

    Thanks for the tutorial! Around 1:45 in this video you are defining item.length and I see that in addition to predictive text, a summary of the legend property displays in your editor. Is this a built in function of Atom or some extension to display these summary/description of the property? This would be very helpful for learning the purpose of each property, etc. Any advice on how to enable/where to find this? Thanks!

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

    Pop and push were stack operations in Assembler :)

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

    thanks a lot, it is for kettles like me

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

    Again.. Thanks a lot brother!

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

    Hey Daniel! Tks for the new video :) Can u share the link for all the properties and methods?

    • @Dani_Krossing
      @Dani_Krossing  6 лет назад +2

      Sorry forgot about that :) will add it now

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

    great explanation. thanks!

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

    hyped for the next episodes ! great work, it helped me a lot! :)

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

    this is just like c#

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

    your videos are perfect for recaps

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

    Thanks

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

    Great stuff man!

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

    Good Job

  • @NERO-ez1mn
    @NERO-ez1mn 6 лет назад

    1 like for the list

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

    is let and var is just the same?

    • @Dani_Krossing
      @Dani_Krossing  6 лет назад +3

      I have an episode earlier in this course where I cover let and var :)

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

      mmtuts thank you I will watch later. ❤️

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

      @@raiserjs I think he meant this one (not in this playlist) ruclips.net/video/siqBNpvEbEQ/видео.html

  • @kerengan-or5418
    @kerengan-or5418 6 лет назад

    Great video! Thank you

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

    Please slow your English when you speaking sir. Very difficult to understand. Very first you speaking. I am a beginner and love to watch yr each video but yr English is very much first. Hope you understand my request.

    • @betzalelgoldman779
      @betzalelgoldman779 6 лет назад +3

      Just in case you didn't know, you can slow down a youtube video in the youtube settings. works pretty well.