In javascript, what are the common methods for arrays ?, Javascript Array
Answer:
Push
Pop
Shift
Unshift
Join
Sort
Concat
Reverse
Splice
Slice
IndexOf
What is this representation in the javascript array?
The comma operator executes the expressions on both sides of the expression from left to right and obtains the value of the expression on the right.
So a [] is actually a [1], and the first 1 has no effect.
Of course, a [1] [1] and a [1] are completely different.
The most common comma is used in the for loop.
For (I = 0; I <10; I ++, j ++)
{
K = I + j;
}
At the end of each loop, the for statement only allows a single expression to be executed ., The operator is used to allow multiple expressions to be treated as a single expression, thus avoiding this restriction.
What are the arrays in javascript?
I don't understand what you mean.
There is only one array in js. There are three defining methods.
Fruit = new Array (3); // fruit = new Array ();
Fruit [0] = "apple ";
Fruit [1] = "Pears ";
Fruit [2] = "orange ";
Fruit = new Array ("apple", "Pear", "orange ");
Fruit = ["apple", "Pear", "orange"];