键盘快捷键

使用 跳转章节

使用 S/ 在本书内搜索

使用 ? 显示帮助页面

使用 Esc 隐藏帮助页面

Block

The Block function is used to create a scope, isolating the environment.

Parameters

The Block function accepts any number of parameters.

Return Value

The Block function returns the value of the last parameter, or Unit[] if no parameters are provided.

Examples

Let[x, 2];
Print[x]; (* 2 *)
Block[
  Let[x, 10],
  Print[x], (* 10 *)
];
Print[x]; (* 2 *)