JS Arrays๋?
- colletion of things
๋ ๋ฆฝ๋ ๋ณ์๋ค์ ํ๋์ ๊ทธ๋ฃน์ผ๋ก ๋ฌถ์ด์ค
ex) ์ผ์ฃผ์ผ ๋์ ๋จน์ ์ ์๋๋ก 7์นธ์ผ๋ก ๋๋์ด์ง ์ฝํต
1. ๋ฐฐ์ด์ ๊ฐ์ ์งํฉ์ด๋ค.
2. ๋ฐฐ์ด์ ๊ฐ์ ์์์๋ ์งํฉ์ด๋ค.
- [ ] ๋๊ดํธ ์ฌ์ฉ
- 0๋ถํฐ ์์
- type of = 'object'
ARRAY METHODS
- Push - add to end
- Pop - remove from end
- Shift - remove from start
- Unshift - add to start
MORE METHODS
- concat - merge arrays
- includes - look for a value
- indexOf - just like string.indexOf
- join - creates a string from an array
- reverse - reverses an array
- slice - copies a portion on an array
- splice - removes/replaces elements
- sort - sorts an array
# concat
cats.concat(dogs)
๋จผ์ ์ ์ด ์ค ๋ณ์๊ฐ ์์ ๋์จ๋ค.
# includes
includes๋ boolean methods๋ผ์ true ์ false ๋ ๊ฐ์ง ๊ฐ๋ง ๋ฐํํ๋ค.
์ด ๋ ๋,์๋ฌธ์๋ ๊ตฌ๋ถํจ.
# indexOf
# reverse
# slice
# splice
# sort
'javaScript' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
์กฐ๊ฑด๋ถ ๋ค์คํ (nesting) - if๋ฌธ ์ค์ฒฉ (0) | 2022.09.19 |
---|---|
if/else/else-if ๊ตฌ๋ฌธ์ ์ฌ์ฉํด๋ณด์. (0) | 2022.09.19 |