JavaScript what is a function

Source: Internet
Author: User

A function is a set of words that perform a particular function. Without a function, it may take five lines, 10 rows, or even more code to complete the task.

This is not full can put the completion of a specific function of the code block into a function, call this function directly, save the trouble of repeatedly entering a large number of code.

How do you define a function? The basic syntax is as follows:

Function name ()

{

function code;

}

Description

1.function defines the keyword for the function.

2. Function name, the name of the function you are taking.

3. function code, replace with code that completes a specific function.

<!doctype html>

  

JavaScript what is a function

Related Article

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.