Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function firstAndLastKNumbers(arr) {
- let index = arr.shift();
- let firstEl = arr.slice(0, index);
- let lastEl = arr.slice(arr.length - index)
- console.log(firstEl.join(' '));
- console.log(lastEl.join(' '));
- }
Add Comment
Please, Sign In to add comment