Advertisement
pacho_the_python

Vzemi tozi JS

Feb 25th, 2023
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. function train(input) {
  2. let wagons = input[0].split(' ').map(function (num) {return Number(num)}).reverse().filter(function (num) {return num > 10})
  3. console.log(wagons.join(' '))
  4. }
  5.  
  6. train(['32 54 21 12 4 0 23',
  7. '75',
  8. 'Add 10',
  9. 'Add 0',
  10. '30',
  11. '10',
  12. '75'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement