Discover javascript book with exercises, include the articles, news, trends, analysis and practical advice about javascript book with exercises on alibabacloud.com
{//map parameter is a function that receives 3 parameters, namely Item,index,array return (item > 2);The condition of the running function}); Console.log (Mapresult); 4,5,8,6 returns a new array consisting of the result of calling this function;
Iterating through an array
JS iterates through an array in two ways:
For loop
var num = [5,15,6]; for (var i = 0; i
For...in
var num = [5,15,6]; for (var i in num) {Console.log (Num[i]
the same date, the number of milliseconds returned is settime () nbsp Set the date in milliseconds, change the entire date getyear () Returns the 2-digit year getfullyear () 4-digit year setfullyear () Set the 4-digit year getmonth () return month setmonth () set month, month must be greater than 0, more than 11 add month getdate () Return Date (1~31) setDate () Set the number of days in the month, if the value passed in exceeds the nu
(a.length); // 1 3 Console.log (a[0]); // 3 4 5 varnew Array (3 6 Console.log (b.length); // 3 7 Console.log (b[0]); // undefined When a floating-point number is passed to the new Array (), an error is directly1 var a = [3.14]; 2 Console.log (A[0]); // 3.14 3 4 var New Array (3.14); // error: test.html:377 uncaught rangeerror:invalid Array lengthThe number of incoming numbers can be:1 var New Array (for each); 2 Consol
parameters of the ECMAScript function as local variables.The execution Environment execution Environment defines other data that a variable or function has access to, determines their own behavior, and each execution environment has a variable object associated with it, and all variables and functions defined in the environment are stored in the object. The code we have written cannot access this object.
The global execution environment is not destroyed until the application exits, suc
I think you have seen the effects of reading images. In this article, I will introduce how to implement Javascript. The specific code is as follows. If you are interested, refer to picture.html.
The Code is as follows:
JS achieves Image book turning
I think you have seen the effects of reading images. In this article, I will introduce how to implement Javascript. The specific code is as follows. If you are interested, refer to picture.html.
The Code is as follows:
JS achieves Image book turning
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.