这是纯粹的功能吗?使用嵌套(Closure like)函数中的值

时间:2016-05-24 05:43:19

标签: javascript functional-programming

使用嵌套(Closure like)函数中的值,例如:

f2

a没有a的arg,但会返回f1范围内的string strResult = "the square of " + dblSquare + " is " + dblSquare * dblSquare;

1 个答案:

答案 0 :(得分:2)

a是一个常量且引用透明的。只要不关闭可变状态,f2是一个闭包并不重要。