| 1234567891011121314151617 |
- const todo = ['Call with Jon', "Return Mom's trimmer", 'Get Insurance', 'Register for wcb', 'Wake up for christmas']
- // Delete the 3rd item
- todo.splice(2, 1)
- // Add a new item onto the end
- todo.push('Email Paulo')
- // Remove the first item from the list
- todo.shift()
- console.log(`You have ${todo.length} todos.`)
- // todo.forEach(function (item, index) {
- // console.log(`${index + 1}. ${item}`)
- // })
- for (let count = 0; count < todo.length; count ++) {
- console.log(`${count + 1}. ${todo[count]}`)
- }
|