WLJS LogoWLJS Notebook

With

With[{x = x0, y = y0, ...}, expr] specifies that all occurrences of the symbols x, y, ... in expr should be replaced by x0, y0, ....

Example

Define local constants:

With[{a = 2, b = 3}, a + b]
(* 5 *)

Useful for injecting values into held expressions:

With[{x = 5}, Hold[x^2]]
(* Hold[25] *)

Please visit the official Wolfram Language Reference for more details.

On this page