1. JavaScript function Type:
(a), the first kind
function Test (param) { return 111;}
(ii), the second type of
var function (param) { return 222;}
Note: Inside the applet is param:function () {
}
This is actually the same wording!
(iii), the third type of
var k = (param) == {return 111;}
Note: The second and third types can be used in callback functions!
2. php function Type:
function Test ($param) { return 111;}
$callback=function() { return ' AA 'echo $callback
Note: PHP and JavaScript function basically the same way, but it seems that PHP does not have an arrow function.
3. Python's function notation
(a), the first kind
# Defining Functions def printme (str): " print any passed-in string " Print str; return # call function printme (" I want to invoke user-defined function! ");
(ii), the second type of
Lambda x,y:x*yprint R (2,3)
Summary: Each major programming language contains a general definition of the function, and anonymous functions, anonymous functions are generally used in the callback function!
The difference between JavaScript and the function of PHP and Python