Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function printEveryNthElement(input) {
- let n = input[input.length - 1];
- input.pop();
- for(let i = 0; i <= input.length; i+=n){
- console.log(input[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement