Answers for "get only first 2 item from array javascript"

6

items from first array that are not in the second array javascript

let difference = arrA.filter(x => !arrB.includes(x));
Posted by: Guest on September-24-2020
2

javascript select first n elements from array

const array = ['toto','tata','titi','tutu'];

array.slice(0, 2); // => ['toto','tata']
Posted by: Guest on March-08-2021

Code answers related to "get only first 2 item from array javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language