DEV Community

Discussion on: Jedi Training Challenge

Collapse
 
siddharthshyniben profile image
Siddharth • Edited

I had to golf it :P
83 81 bytes:

console.log(Array(10).fill().map(_=>(x=~~Math.random()*10+1,x%2?x+5:x<11?x*2:1)))
Enter fullscreen mode Exit fullscreen mode

If anyone can go shorter I'd love to see it!