KB
Size: a a a
KB
KB
E
function init() {
var name = "Mozilla"; // name is a local variable created by init
function displayName() { // displayName() is the inner function, a closure
alert (name); // displayName() uses variable declared in the parent function
}
displayName();
}
init();
E
KB
function init() {
var name = "Mozilla"; // name is a local variable created by init
function displayName() { // displayName() is the inner function, a closure
alert (name); // displayName() uses variable declared in the parent function
}
displayName();
}
init();
E
KB
E
KB
E
var b = 1;
function Foo() {
console.log(b);
}
S🛸
KB
KB
KB
with_lambda = lambda x: x * 2
FOO = 2
def withClojure(x):
return x * FOO