Advertisement
nikolayneykov

Untitled

May 6th, 2019
329
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.  
  12. const test = ['0 15 30']
  13. const gets = this.gets || getGets(test)
  14. const print = this.print || console.log
  15.  
  16. let degrees = gets().split(' ').map(Number)
  17.  
  18. for (let i = 0; i < degrees.length; i++) {
  19.   degrees[i] = degrees[i] * 1.8 + 32
  20. }
  21.  
  22. degrees.forEach(function (degree, index) {
  23.   print(degree)
  24. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement