js-eval-replace README
Replaces selected text with it's JavaScript evaluation
Usage
Highlight any JavaScript expression or script, and evaluate it by pressing Ctrl+Alt+J
on windows or linux, or Cmd+Alt+J
on mac. The selected text is replaced.
Alternatively, use the "Eval-Replace" option from the command list.
Examples
Copy the following pieces of text into an editor pane, highlight, and use eval-replace on them:
123 * 456
"This is some ugly\n\"unescaped\" text!"
"UPPERCASE TEXT".toLowerCase()
decodeURIComponent("q=%7B%22foo%22%3A%22Hello%20World%22%7D")
Also evaluates whole scripts! Use return for the result:
function factorial(n) {
return n > 1 ? n * factorial(n - 1) : 1;
}
return factorial(4);