The array in JS1, The basic concept of the array? An array is a collection of ordered data that is stored continuously in memory space. The order of the elements in the array, called Subscripts. You can use the subscript to access each element of
Object
====================
Location
This object stores the information of the current URL. It is part of the window object and can be obtained through the windows. location attribute.
Document
Any HTML document loaded into the browser will
Today is the last section of the js getting started series demonstration (I plan it for the moment), but please remember, if you are familiar with the previous examples, it does not mean that we understand JS. Even when we get started, we have to
[the array in JS]1. The concept of arrays: arrays are structures that store multiple sequential elements in memoryThe order of the elements, called subscripts, is to find the corresponding element by subscript.2, the Declaration of the array:①
Concat () joins the element into the array join () converts all elements of the array into strings and joins together splice () inserts, deletes, replaces the array element push () adds the element to the end of the array pop () moves the last
1. What data types are returned by JavaScript typeofReturns the six-type number string object function undefinedExample:typeof 37=== ' number ' typeof "str" = = = ' String 'typeof true=== ' Boolean ' ; typeof undefined=== ' undefined 'typeof {a:1}===
Before I read a blogger said that the learning front-end to develop the habit of blogging, I slowly learn to write something on it, record my study.This period of time to learn the JS Foundation to fill a little, learn some of the operation of the
Context invocation PatternYou can modify the value of this, that is, you can modify the function call method, apply, call can modify the function invocation context, that is, the value of thisScript> varname= "Leonardo's self-reliance and Guo";
Push: Adding a return value to the end of the array is the new length of the arrayUnshift: Adding a return value to the beginning of the array is the new length of the arrayPop: Delete the end item of an array the return value is a deleted array
Array functions(both index and ARR in the callback function here can be omitted, the callback function has parameters that are set to adjust this point, which is not used here for the time being)
ForEach ()
Map ()--Update array
7.number && Data conversion to number typeInitializationvar number = new Number (' 23 ');//Use the constructor to create * use the TypeOf operator to return ' object '; Use the type function to return ' number ';var number = 23; Direct
Javascriptkey points of knowledge cardingone. Javascript Process Control
The data types commonly used in JS
Use of the VAR keyword
If–else If–else
Switch
While
For
two. Javascript Common Functions
1. String
When you look at the client code, you often encounter JavaScript scripts, the system to learn a bit more in the future to understand the client is good.1. Application ScenariosImproved designValidating formsdetecting browsersCreate cookies, etc.2.
We all put JavaScript code in 1.JavaScript code written in internal2. Put the JavaScript code in a separate. js file, and then in the HTML by introduce this file this is not necessary because the default type is JavaScript, so you do not have to
Learn to program the Java Learning Array published, welcome to visit through Xuebiancheng8.com.The following is an analysis of the arrays in Java.What is an array, why use an array, join now need to count a class of exam results, this class has 30
First, JavaScript introduction method1. Write code in script tag2. Introduction of additional JS filesSecond, JavaScript language specification1. CommentsThis is a single-line comment/*This is a multi-line comment*/2, TerminatorThe language in
Method One: Using the array concat method, this method belongs to a trickeryvar arr= [[0,0,1],[2,3,3],[4,4,5]]; var newArr = []; for (var i=0;i) { newArr=newarr.concat (arr[i]) }Console.log (arr)
Create an array
Merging two arrays-concat ()
Merging three arrays-concat ()
Make a string of elements of an array-join ()
Delete the last element of an array-pop ()
Add a new element to the end of the array-push ()
Arrays play a very important role in JavaScript. Any control development cannot be separated from the use of arrays.constructor functionNew Array () new Array (size) new Array (element0element1elementn)Parameters
size
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.