Advertisement
Spocoman

01. Print N-th Element

Jan 23rd, 2022
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(arr) {
  2.  
  3.     let print = "";
  4.     for(let i = 0; i < arr.length - 1; i += Number(arr[arr.length - 1])) {
  5.         print += `${arr[i]} `;
  6.     }
  7.     console.log(print.trim());
  8.  
  9. }
  10.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement