Last active
August 29, 2015 14:27
-
-
Save Arwid/9cba116c87f64f6d90c6 to your computer and use it in GitHub Desktop.
lodash extension to evaluate expressions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// lodash extension to evaluate expressions | |
_.eval = function(expression, scope) { | |
return _.template("<%= " + expression + " %>")(scope); | |
} | |
_.eval = function(expression) { | |
return _.template("<%= " + expression + " %>"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment