Instead of the memory in the computer, it is better to take out to help a group of small white HTML one

Source: Internet
Author: User

<! DOCTYPE html>
<meta charset= "UTF-8" >
<title> Function Learning </title>
<script type= "Text/javascript" >
/*show ("Zhang San", 22);
Function Show (name,age) {
Alert ("Name:" +name+ "Age:" +age);

}
(function (name,age) {
Alert ("Name:" +name+ "Age:" +age);
})
("Zhang San", 22);
var f=function (name,age) {
Alert ("Name:" +name+ "Age:" +age);
}
F ("Zhang San", 12); */
/*var f=new Function ("name", "Age", "alert (' Name: ' +name+ ' ages: ' +age)");
*//*f ("Zhang San", 23);
Alert (f instanceof Function); *//*
WINDOW.F ("Zhang San", 10); */
/* Function Show () {
return function () {
Alert ("Sasds");
};
}
var f=show ();
f (); */
/*var name= "Chenghao";//global variable
Function Show () {
var name= "Zhangsan"
var age=10;//local Variables
Alert ("Name:" +name+ "Age:" +age);
}
Show ();
*//*
Function F1 () {
var name= "Limeilan";
function F2 () {
var age=23;
alert (name,age);
}
F2 ();
}
F1 (); */
The concept of closures
/* Function F3 () {
var n=1;
function F4 () {
alert (n);
}
return f4;
}
var f=f3 ();
f (); */
Function Show (name,age) {
Alert ("Name:" +name+ "Age:" +age);
}
Window.show ("Zhang San", 22);
Show.call (window, "Zhang San", 10);
Show.apply (window,["Zhang San", 11]);
Function Show (Arr,func) {
Func.call (Window,arr);
}
Show ([1,2,3,4],function (arr) {
For (i in arr) {
document.write (arr[i]+ "<br/>");
}
});

</script>
<body>

</body>

Instead of the memory in the computer, it is better to take out to help a group of small white HTML one

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.