Common JavaScript function type_javascript skills

Source: Internet
Author: User
Tags types of functions
This article mainly introduces three types of functions commonly used in JavaScript, including anonymous functions, dynamic functions, and variable parameter functions, if you are interested, refer to the java code on the webpage that needs to be written in JavaScript, which contains some functions and describes the common function types in JavaScript.
1. Variable Functions

Script function show () {alert ("first... ");} Function show (str) {alert (" second ");} function show (a, B) {alert (" third... "); Alert (a +": "+ B);} script 
  
    
 Script show (); // When called, the previous show will be washed out // undefined: undefined show (111); // after the call, the previous one will be washed out. // 11: undefined show ("a", "B"); // after the call, the previous one will be washed out. //: B show (,); // script


In summary, functions in Javascript do not have heavy loads. All of them must be configured. Although a function declares several variables during definition, it can be passed in to any variable during the call. Each function contains a default array of arguments, which stores all the arguments passed in during this call.

2. Anonymous Functions

          
    

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.