Ciao.
Sto facendo un po di confusioneCodice PHP:function sayHello2(name) {
var text = 'Hello ' + name; // local variable
var sayAlert = function() { alert(text); }
return sayAlert;
}
leggo:
quiIn JavaScript, if you use the function keyword inside another function, you are creating a closure.
ma sayAlert non è anche un metodo
privato di sayHello2 e text una proprietà
sempre privata di sayHello2 ?
![]()


Rispondi quotando