Easy and fun! Thx for kata!
I would like to have second part with arrows in all directions, and maybe third with more complex conditions.
i will fix it
In JS, the function in the initial solution should be declared as const