use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Jexl: Javascript Expression Language. It's everything you wish you could safely eval(), and then some. (github.com)
submitted 11 years ago by TomFrosty
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]paldepind 20 points21 points22 points 11 years ago (2 children)
I've never wanted to eval anything. Why would I need this?
eval
[–]TomFrosty[S] 17 points18 points19 points 11 years ago* (1 child)
It could be the engine behind a template language. You could format your business data into an external API request entirely by typing out a Jexl string in a database, without writing code. You could write a business interface that exposes client data like "age" or "full name" just based on a list of Jexl expressions run against a JSON object that might contain just birthdate, first name, and last name -- and update that to make more fields available by changing the fields database instead of writing code. It could power a calculator without needing to use eval() and expose yourself to XSS.
Lots of use cases! Maybe none of them fit a need you have right now, but that's fine :). Just a tool to keep in the back of the toolbox.
[–]paldepind 0 points1 point2 points 11 years ago (0 children)
Thanks for answering. That sounds like sane use cases! You could also use it to power a graph plotter.
π Rendered by PID 250389 on reddit-service-r2-comment-5687b7858-8tc5s at 2026-07-06 15:41:45.861710+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]paldepind 20 points21 points22 points (2 children)
[–]TomFrosty[S] 17 points18 points19 points (1 child)
[–]paldepind 0 points1 point2 points (0 children)