notes.js 306 B

123456789101112131415
  1. const notes = ['Note 1', 'Note 2', 'Note 3']
  2. // console.log(notes.pop())
  3. // notes.push('My new note')
  4. // console.log(notes.shift())
  5. // notes.unshift('My first note')
  6. // notes.splice(1, 1, 'This is the new second item')
  7. notes[2] = 'This is the new note 3'
  8. console.log(notes.length)
  9. console.log(notes)