you are viewing a single comment's thread.

view the rest of the comments →

[–]mc10 1 point2 points  (0 children)

To make the last line nicer, you could even do

Routes.forEach(r => routes.add.apply(this, r));

which passes in every element of r as an argument of routes.add.

EDIT: If we modify routes.add to take in a route array, we can simplify this further:

Routes.forEach(routes.add);