JavaScript Learning Notes

Source: Internet
Author: User

---restore content starts---

Local variables: Use the keyword var to name the variable and only use it in the function that defines it!

Global variables: can be used anywhere! Defined outside the function!

closures: Child functions can use local variables of the parent function!          

function A () {  var  b =2;    function C ()   {      alert (b);    // 2    }}

Break: The entire loop jumps out of the interrupt!!!

Continue: Cycle Skip this time!

Aguments: variable parameter, indeterminate parameter, can be used as an array, the stored value is the parameter passed to the current function!

The following two functions are equivalent, the first function with a similar function of the method, abbreviated the second!

function sum (obj,name,value) {    =value;}


{
ARGUMENTS[0].STYLE[ARGUMENTS[1]=ARUMENTS[2];

}

Array: Splice (start, length) can be used to insert, delete, add array elements

var aar = [1,2,3,4,5,6]arr.splice (2,3);                // Delete: Splice (starting point, the length of the element to delete) Arr.splice (2,0, ' A ', ' B ', ' C ');   // Insert: Splice (start, length, element to insert) Arr.splice (2,2, ' A ', ' B ');      //Add: Splice (start, delete element length, element to add)

JavaScript Learning Notes

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.