One of the basics of javascript---function
Definition of Function:
1. Direct definition
Function Test () {
content, the logic that you want to handle
}
2. Variable type
var demo = function () {
content, the logic that you want to handle
};
3. Use function
var fun = new Function (' fun ', ' Conlose.log ' ("content, logic to be processed");
1/22 are often used, and the third is Rare. The first function definition is promoted to the front, and the latter is Not.
Test ();
Demo ();
function Test () {}
var demo = function () {};
After promotion:
function Test () {}
var demo;
Test ();
Demo ();
Demo = function () {};
The parameters of a function can be of any type, such as 1, ' * * ', {},function () {}, etc., can be used inside the function this and arguments,this are scopes, arguments is a parameter collection is an array of classes
function definition of JavaScript