pulusatapathy

fill

Oct 23rd, 2020
741
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const original = [1, 2, 3]
  2. const result = original.fill(4)
  3. console.log('original', original)
  4. console.log('result', result)
  5. console.log(original === result)
  6.  
  7. ---------
  8. Output
  9. ---------
  10. original > (3) [4, 4, 4]
  11. result > (3) [4, 4, 4]
  12. true
RAW Paste Data