Current attempt https://is.gd/GCYWD0 — involves `new Function` and building code from strings — yuck. There’s a better way?
Given “/users/:id”, what’s the right JS approach to generate a function `foo` such that `foo({id: 42})` produces the string “/users/42”?
-
-
-
Why not just return a lambda? Do you _need_ the function body to be 'compiled'?
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.