Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

use global variable in anonymous function

$variable;

functionName($someArgument, function() use(&$variable) {
  $variable = "something";
});

this is called closure;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #global #variable #anonymous #function
ADD COMMENT
Topic
Name
7+1 =