click below
click below
Normal Size Small Size show me how
JS Arrays
Javascript Arrays
Question | Answer |
---|---|
Add item to array end of array | array.push(item) |
Add item to beginning of array | array.unshift(item) |
add item to specific point in array | array.splice(start, delete_count, new_item) |
Check if item is in array -returns 0 || -1 | array.indexOf(item) |
Check if item is in array -returns true || false | array.includes(item) |