/JS-Array---String-Methods

A repo of some of the most used Array and String Methods for Javascript. Awesome to know early on your career as a dev. Get started for FREE on #100Devs, be sure to Check https://www.leonnoel.com/100devs for more info. !

Primary LanguageJavaScript

Javascript Array & String Methods

A repo of some of the most used Array and String Methods for Javascript. Awesome to know early on your career as a dev. Get started for FREE on #100Devs, be sure to Check leonnoel.com for more info. !

I will be updating this as i study more methods. This works awesome alongside the usage of Anki: https://apps.ankiweb.net/
(If you have an Android phone be sure to download AnkiDroid: https://play.google.com/store/apps/details?id=com.ichi2.anki&hl=en&gl=US )
And if you want the best study tips to avoid the forgetting curve, be sure to check this video by Ali Abdaal: https://www.youtube.com/watch?v=ukLnPbIffxE

Array Methods

  • map()
  • reduce()
  • filter()
  • forEach()
  • sort()
  • slice()
  • pop()
  • shift()
  • push()
  • unshift()
  • includes()
  • indexOf()
  • every()
  • concat()
  • join()
  • reverse()
  • splice()

Questions to Practice Common Array Methods

ONE

Given a non-empty array of integers, return the result of multiplying the values together in order. Example: [1, 2, 3, 4] => 1 * 2 * 3 * 4 = 24

TWO

You will be given an array of all the family members' ages, in any order. The ages will be given in whole numbers, so a baby of 5 months, will have an ascribed 'age' of 0. Return a new array with [youngest age, oldest age, difference between the youngest and oldest age].

THREE

Sum all the numbers of the array except the highest and the lowest element (the value, not the index!). Example: [ 6, 2, 1, 8, 10 ] => 16 [ 1, 1, 11, 2, 3 ] => 6

String Methods

  • charAt()
  • charCodeAt()
  • concat()
  • includes()
  • indexOf()
  • match()
  • repeat()
  • replace()
  • search()
  • slice()
  • split()
  • substr()
  • toLowerCase()
  • toUpperCase()
  • trim()

Want to learn how to code for free? Then be sure to check out #100Devs on https://leonnoel.com/100devs/ . The next cohort starts on November 2021