Advertisement
Stanislavgr

Converter_Workshop_1

Apr 18th, 2019
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 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.  
  12. const test = [
  13. 20,
  14. ];
  15.  
  16. const gets = this.gets || getGets(test);
  17. const print = this.print || console.log;
  18.  
  19. let m = +gets()
  20. let km = m * 1.6
  21. let litersPer100 = 4.54 * 100/ km
  22.  
  23. print(math.round(litersPer100), 'litres per 100 km')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement