Advertisement
nikolayneykov

Untitled

May 6th, 2019
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 = ['0 15 30']
  12.  
  13. const gets = this.gets || getGets(test)
  14. const print = this.print || console.log
  15. gets()
  16.   .split(' ')
  17.   .map(x => Math.round(+x * 1.8 + 32))
  18.   .forEach(x => print(x))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement