The method for declaring a function in javascript and the return value for calling the function.
<Html xmlns = "http://www.w3.org/1999/xhtml">
What is the return value of javascript Functions? What are the functions?
Funcion is the English name of a function. Use this to declare a variable. The returned value is to return the variable to be called with a column: function func (a, B) // declare a function named func. the function has two variables a and B (which can also be values) {// the code of the function starts from {and ends from} x = a * B // you can apply for a formula by yourself. apply. a + B a % B can return x // return the value of x, that is, the variable that calls this formula} // Function Code ends var num = func) // This is the variable num that calls the func function, inherits the formula in func, and gives a = 1, B = 2. the Return Value of the above function is returned here. after calling the formula in func, the value of the variable num is a * B, that is, 2*3. So the value of num is 6.
What is the return value of javascript Functions? What are the functions?
A function is an event-driven or reusable code block that is executed when it is called.
Compile the script as a function to avoid executing the script when loading the page.
A function contains code that can only be executed when an event is activated or called.
You can call the script anywhere on the page (if the function is embedded with an external. js file, you can even call it from other pages ).
The following are related details:
Www.w3school.com.cn/js/js_functions.asp