Advertisement
Guest User

Untitled

a guest
Apr 15th, 2019
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. const getGets = (arr) => {
  2. let index = 0;
  3.  
  4. return () => {
  5. const toReturn = arr[index];
  6. index += 1;
  7. return toReturn;
  8. };
  9. };
  10. // this is the test
  11. const test = [
  12. '5'
  13. ];
  14.  
  15. const gets = this.gets || getGets(test);
  16. const print = this.print || console.log;
  17.  
  18. const n = +gets()
  19.  
  20. function getArray(n1) {
  21. for (let index = 0; index < n1; index++) {
  22. let result = index * 5;
  23. print(result)
  24. }
  25. }
  26. getArray(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement