1. ECMAScript does not have a block-level scope, so variables defined inside the loop are also accessible outside the loopegvar count = 10;FPR (var i=0; ialert (i);}alert (i); 102. The function of ECMAScript can define any parameter, and the two
Talking about the javascript iteration method and the javascript
Each of the five Iteration Methods accepts two parameters: the function to run on each item and the scope of the function to run (optional)
Every (): run the given function for each
One, Object traversalES6 there are altogether 5 ways to traverse the properties of an object.1 , For-inWhen you use the for-in loop, you return all the enumerable (enumerated) attributes that can be accessed through the object, including the
1. Reference type 1.1 Object typeThere are two ways of creating an object type:
Use the new operator followed by the object constructor
var person =new Object ();
Notation of character volume
var person = {Name: ' Chuck '}
One, array
(1) Detection array
For a global scope, you can use the instanceof operator to detect whether an object is an array:
The code is as follows
Copy Code
if (value instanceof Array) {//}
However, if
The array type in JavaScript differs greatly from an array in other languages. each item in JavaScript can hold any type of data. also, the size of the JavaScript array can be dynamically adjusted and can grow automatically as the data is added to
To determine whether an object is an array: instanceof, Array.isarray ()
You can use the instanceof operator for a Web page or a global scope.
if (value instanceof Array) {//To determine if value is an array}Instanceof operator It assumes that
An array of ECMAScript differs considerably from an array in other languages. Although the array in ECMAScript also has a sequence table, it is an array of your every item can hold any type of data. The size of the ECMAScript array can be
Next is a "JavaScript array array Basics", which details all the methods of array.
The methods of all arrays are defined on Array.prototype, and the Array.prototype itself is an array.
Array.concat ()
Shallow copies the current array and attaches
Inheritance is one of the most talked-about concepts in oo language. Many OO languages support two ways of inheriting: interface inheritance and implementation inheritance. Interface inheritance inherits only the method signature, while implementing
Reading Table of Contents
Object type
1, through the constructor to create2. Creating objects by literal notation
Array type
The same array can also be created in two ways:If we want to print all the values in the array, we can print the
This article mainly summarizes the array methods of javascript in detail, including the most commonly used array methods and extension methods. If you are interested, please refer to them.
I. Common Methods of Arrays
1: join ();
Convert the array
(Part 1)--------------------------------------7. debugging Interface--------------------------------------Lua does not have built-in debugging functions. Instead, functions and hooks provide a special interface to build different types of debuggers,
1, JS commonly used array Object properties:, which is marked with a red circle, and is a new attribute for ES5.2, browser support situation:
ie:9+;
Chrome;
firefox2+;
Safari to the most;
Opera 9.5+;
3. Position
One: An array of common methods:1:join ();Converts an array to a string display. The parameter is not entered, the default is a comma connection, and the input parameter is concatenated with the parameter.var arr=[1,2,3];console.log (Arr.join ());
Arrays should be data types that are used extremely frequently in every language, and JavaScript is no exception.Personally, the array type in JS is very powerful.There is no need to specify the length of the array (not mutable) when the array is
Http://www.cnblogs.com/Yfling/p/6681207.htmlString
Method
Description
CharAt ()
Returns the character at the specified position.
charCodeAt ()
Returns the Unicode encoding of the
There's a lot of new stuff in ES5, and knowing it helps us write JavaScript, like arrays, we probably don't need to rhythmic for loops.
The write array method is added to the ES5, as follows:
ForEach (JS v1.6)Map (JS v1.6)Filter (JS v1.6)Some (JS
This article mainly summarizes the array methods of javascript in detail, including the most commonly used array methods and extension methods. if you are interested, please refer to them.
I. common methods of arrays
1: join ();
Convert the array
JavaScript Array-Array method summary (recommended), javascriptarray
The Array type in JavaScript is frequently used. The Array type also provides many methods to meet our needs. Let's summarize the following:
1. method for creating an Array
Var
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.