JavaScript Arrays & Map Method Tutorial - Google Apps Script Part 4

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

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

  • @Wrynst
    @Wrynst 5 лет назад +26

    This is exactly what I have been wanting since your last Apps Script + Sheets series! Been subscriber since the start and I am always looking forward to your next video.
    You deserve more praises than I can give.
    This channel has changed my life. No joke. These videos got me back to coding, and for that, I cannot thank you enough.

  • @Ancode2
    @Ancode2 3 года назад +3

    This is the simplest and very efficient tutorial about map in entire RUclips. Really appreciate your work

  • @giamar3026
    @giamar3026 5 лет назад +5

    Thank you!!!. Could be hours watching your videos, they are superlative on teaching GAS and JS. Not everyone could be a good teacher...you are just perfect!

  • @KhalilYasser
    @KhalilYasser 5 лет назад +5

    Thanks a lot for great tutorials. God bless you

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

    Thank you very much, exactly the very thing I am looking for either, can express enough thanks for you to share this. Thanks a lot!

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

    Your style of presentation is spot on.

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

    its very useful.... thank you...

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

    I am coding after 35 year. Seriously, after Qbasic and fortran. Thanks so much for these videos.
    That said, I think a more elegant way of doing the age increment would be
    row[1]++;
    return row;

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

    Map is the most interesting method i found in JavaScript

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

    useful

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

    Thank you very much !!!

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

    🙏🏻

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

    Hello! I’m checking out this video because I only have a loose grasp as to how to make the map method works. I’ve looked all over for an answer about this, but: do you, personally, know how I could do an if statement to check if an element in an array is “null”? As in, the content of an element in the array has that specific falsey value? The problem I’m having is that, no matter what I do, the project thinks I’m testing if the presence of the element is true or false, not the literal content of the element. I’m willing to even get a direction as to proceed. I’m not sure what exact search terms will give me what I want.

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

      I'm guessing you need ISNUMBER(MATCH together, but impossible to tell without seeing your data sample. Spreadsheet "falsey" is probably never going to be the exact same as JaavaScript falsey.

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

    I have been following the tutorials for a while and they are very helpful. I am now building a script and I am using the map method in a but i noticed it overwrites the data in the original array it is mapping. Is this supposed to happen?

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

    Hi Teacher! Thank you as i always say for your excellent classes. Would you mind to show as how to add a random selection to the map return list? Than you again Erne

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

    @Learn Google Spreadsheets
    /It's a translator.
    특정 열에서 값들을 각각 정해진 갯수만큼 가져오는 방법이 있습니까?
    (Is there a way to get a certain number of values from a particular column?)
    ex) as-is..
    [A , 1]
    [A , 2]
    [A , 3]
    [B , 4]
    [B , 5]
    [B , 6]
    [C , 7]
    [C , 8]
    [C , 9]
    행렬의 첫번째 열에서 A는 2개, B는 1개, C는 2개 만 가져오고 싶습니다.
    (In the first column of the matrix, I would like to bring 2 for A, 1 for B, and 2 for C.)
    ex) to-be..
    [A , 1]
    [A , 2]
    [B , 4]
    [C , 7]
    [C , 8]
    p.s.
    "I am watching your videos well. I'm very impressed. Thank you.
    "

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

    Thanks a Lot.

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

    What if I want to append row in this arraw. Is there anyway that It wont overwrite the other existing row? because im trying to figure out how to update and add new data in existing record in my database. can you please help me with this. thanks

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

    Hope you receive back as much as you give

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

    Can you perform any date operations inside a 2D array using map function?
    Like adding a day, increment a month in google sheets using script

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

    Here's the code used in the video
    pastebin.com/WwCV2s6Q

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

    Great tutorial as usual, thank you so much, is it possible to remove duplicates in the array with map?
    e.g in your case, let say you have 2 Linda two times, how can you remove the whole row based on the duplicate in cell of the row?

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

      map always returns the same number of rows as the original array. You will need to use forEach or reduce methods.

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

    Thank you. How do you add the "Math.round" function to the map method? For example, what if I want to round Column C to the nearest hundredth?

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

      .map( return Math.round(x*100)/100);

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

      forgot the callback
      .map(function(x){ return Math.round(x*100)/100});

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

      @@ExcelGoogleSheets Thank you!

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

    Sir, how I could change array from this?:
    [ ]i
    0: Array(5)
    0: "tes1"
    1: "tes2"
    2: "tes3"
    3: "tes4"
    4: "tes5"
    length: 5
    to this Sir:
    (5) ["tes1", "tes2", "tes3", "tes4", "tes5"]
    0: "tes1"
    1: "tes2"
    2: "tes3"
    3: "tes4"
    4: "tes5"
    length: 5

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

    Great tutorial! Thank you. Just wondered why not you have used 'column' instead of 'row' as a variable inside function!!! LOL

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

      He just used row , (I think though) for illustration. In my opinion, he could also have used cell[0] for clearer coding.

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

      Actually, just saw that it's a two dimensional array, it's possible to also use column to name them.

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

    So are map and filter function same??

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

      Use map when you want to modify records in your data and get a result with exactly same number of rows as your original data.
      Use filter when you want to get a subset of your data, so instead of all rows it will get you some of them that match a certain criteria.

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

      @@ExcelGoogleSheets thank you for replying and that to so fast...👍 I have learned a lot from your videos , i always thought that i knew almost everything in google sheets but every video i watch i learn something new that is very helpful. Thats why i watch all your videos.

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

    What about arrow functions?

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

      What about them? You can use them if you want, works exactly the same way.

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

    you are very good but you should be a little more concise. E.g. on win you can display consolle.log just with ctrl + enter

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

      he mentioned that in one of the previous tutorials in this series

  • @vladk.6589
    @vladk.6589 4 года назад

    как же это ахуенно! лайк подписка бубенцы