Q:

Write a JavaScript program to get an array with n elements removed from the beginning from a given array

0

Write a JavaScript program to get an array with n elements removed from the beginning from a given array

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const take = (arr, n = 1) => arr.slice(0, n);
console.log(take([1, 2, 3], 5));
console.log(take([1, 2, 3], 0));

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now