Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Eval and ReplaceNew to Visual Studio Code? Get it now.
Eval and Replace

Eval and Replace

Lebster

|
551 installs
| (3) | Free
Execute JavaScript code and replace the code with the result
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Eval and Replace

Execute JavaScript code and replace the code with the result

Original atom plugin

Get the extension

Demo

Demonstration Gif

Usage

You can execute any JavaScript code by first selecting it and then running Eval and Replace: JS from the command palette (or by selecting it and using the default keybinding, Ctrl + Shift + J)

Multiple selections & pre-initialized values

You can evaluate multiple expressions selected seperately, and each will be replaced seperately, however: the same context is used for all selections, so you can reuse variables.

Additionally you have access to these pre-initialized global functions and variables:

  • i, j, n, x, y, z: initialized with 0
  • a, s: initialized with ''
  • PI: Alias for Math.PI (etc. for other Math properties & methods)
  • randomInt(min: number, max: number): generates a random integer between min and max (inclusive of both)

If you have any questions / concerns about this extension, reach out to me on Discord at lebster

Change Log

Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft