JS Learning Note 2 (Chapter 5 operation method)

Source: Internet
Author: User

5.2.5 operation

Concat (); slice ();

5.2.7 method of position operation

The others do not repeat

5.5 Functions

1, the function is actually an object, each function is an instance of the functions object, as with other reference types, have properties and methods.

A function name is a pointer to a functional object.

How to create a function:

1. Functions are generally defined by function declaration syntax

function sum (num1,num2) {return num1+num2;}

2. You can also use function expressions to define

var sum=function (num1,num2) {return num1+num2;} There is no need to declare the name of the function, directly use the variable to refer to the function

3. Use function constructor (not recommended)

var sum=new function ("Num1", "num2", "num1+num2");

5.5.2 function declaration and function expression

The parser first adds a function declaration to the execution environment.

JS Learning Note 2 (Chapter 5 operation method)

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.