Added few methods to JS Array (#1865)
This commit is contained in:
parent
68758d5b26
commit
5fb0ab2a68
|
@ -14,6 +14,8 @@ list = [a,b,c,d,e]
|
|||
```bash
|
||||
list[1] // → b
|
||||
list.indexOf(b) // → 1
|
||||
list.lastIndexOf(b) // → 1
|
||||
list.includes(b) // → true
|
||||
```
|
||||
|
||||
### Subsets
|
||||
|
@ -81,6 +83,10 @@ list.splice(2, 1) // → [c] list == [a,b,d,e]
|
|||
.filter(n => ...) => array
|
||||
```
|
||||
|
||||
```bash
|
||||
.forEach(n => ...)
|
||||
```
|
||||
|
||||
```bash
|
||||
.find(n => ...) // es6
|
||||
.findIndex(...) // es6
|
||||
|
|
Loading…
Reference in New Issue