1. Define array and access, attributes
You can create array object explicitly like [line 2]. It is also possible like [line 8] simply. Like [line 20], you can use any type of object as an array element. If you give other type which is not integer like [line 14, 15], it create attribute of object.
2. length
The length of array is a just last index + 1 as see in [line 5].
3. iteration
You can iterate element of array using for, for-each statement. Of course, you can use for-in statement.
4. concat, push, pop, join
5. shift, unshift
6. slice, splice
The splice function remove element which are in specific range and insert into new elements. You can see element 2, 3 are deleted from Array [1,
7. reverse, sort
8. indexOf, lastIndexOf
The lastIndexOf method start inspecting from last index of array.
9. forEach, map
It is useful when do some work using each element of array as an argument.
10. every, some, reduce
It is useful when do some inspecting work from whole range or specific range.
11. Array Generic Method
12. Reference
- MDN - https://developer.mozilla.org/en/docs/Web/JavaScript
- Jasmine - http://jasmine.github.io/2.3/introduction.html
댓글 없음:
댓글 쓰기