1.Array is dynamically expandable, look, you can push data into the array all the time.
2. You can add an array to a string by using the Join method.
3. Four methods in the array: Push,pop,shift,unshift.
- Push: Add data to the last face;
- Pop: The array finally presents the data;
- Shift: The array front end takes out the data;
- Unshift: Adding data to the front of the array;
4. Other easily confusing methods in the array:
- Slice (INDEX1,INDEX2): intercepts an array with the arguments passed in, containing the previous not included.
- Splice: Can pass in 3 parameters, there are 3 functions
- Delete: The parameter is 2,splice (index,num): The first parameter is where to start, and the second represents the number of items deleted.
- Add: The parameter is greater than 3, and the second parameter is 0: When the first argument starts, the third argument is passed in, and of course the parameter is more than 3.
- Replace: The parameter is greater than 3, and the second parameter is absolutely not 0, where the first argument starts, the second is the number of items to be deleted, the original substitution is to delete the old one, and then insert the new, the remaining parameters are the parameters to be inserted.
JS Array has to say some things