Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const getGets = (arr) => {
- let index = 0;
- return () => {
- const toReturn = arr[index];
- index += 1;
- return toReturn;
- };
- };
- const test = [
- '3',
- '2',
- '5',
- '1'
- ];
- const gets = this.gets || getGets(test);
- const print = this.print || console.log;
- let input = gets();
- let string = '';
- let arr;
- string += input;
- arr = string.split(' ', string.length);
- for (i = 0; i < arr.length; i++) {
- print(arr[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement