Answers for "get 1st 3 record in array javascript"

34

get first 10 items of array javascript

const list = ['apple', 'banana', 'orange', 'strawberry']
const size = 3
const items = list.slice(0, size) // res: ['apple', 'banana', 'orange']
Posted by: Guest on March-30-2020
1

javascript how to get every element after the 1st in an array

var arguments = ['One', 'Two', 'Three'];
var middle = arguments.slice(1, -1); // will take away the 1st from the start and the 1st from the end
console.log(middle); // once logged it will only show 'Two'
Posted by: Guest on March-20-2020

Code answers related to "get 1st 3 record in array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language