闭包

閉包
bìbāo
noun

Meanings

  1. 1 closure (mathematics) — the smallest closed set containing a given set
  2. 2 closure (computer science) — a function bundled together with references to its surrounding state

Examples

Zài tuòpūxué zhōng, jíhé de bìbāo bāohán qí suǒyǒu jíxiàndiǎn.
In topology, the closure of a set contains all its limit points.
JavaScript de bìbāo ràng hánshù néng jìzhù wàibù biànliàng.
JavaScript closures allow a function to remember outer variables.

Tips

usage
Two technical fields, same Chinese term. In math (topology, algebra) 闭包 is the closure operation — the smallest closed set containing your set. In programming, it's a function plus the lexical environment it captured. Context disambiguates instantly; outside math/CS the word is rare.

Stroke Order

bāo