Arguments
- an Array-like object accessible inside functions that contains the values of the arguments passed to that function.
- In order to change it to array
- Array.from(arguments)
- has length property that can count from index #0 but does not have other methods like array
- ๋ด์ฅ๊ฐ์ฒด ํจ์์ ์ ๋ฌ ๋ ์ธ์์ ํด๋นํ๋ ๋ฐฐ์ด ํํ์ ๊ฐ์ฒด
- ํจ์๋ฅผ ์ ์ธํ ์๊ฐ, arguments ๊ฐ์ฒด๋ฅผ ๊ฐ์ง๊ณ ์์
- ํจ์๊ฐ ํธ์ถ๋๋ ์์ ์, ๊ทธ ๋ ์ ๋ฌ ๋ ํ๋ผ๋ฏธํฐ๋ฅผ ์ ์ฅํ ๊ณณ
- ํ๋ผ๋ฏธํฐ ์ซ์๋ฅผ ์ ํด๋๋๋ผ๋, ์ ํํ์ง๋ ์๊ธฐ์, ์ ๊ฒ ๋ฃ๊ฒ ๋๋ฉด undefined๊ฐ ๋๊ณ ๊ฐฏ์๊ฐ ์๊ด์์
- ๋ด์ฅ ๋ฉ์๋๋ฅผ ํฌํจํ๊ณ ์์ง ์์
CSS Selector
-
Grandchildren Selector(ํ์ ์ ๋ ํฐ)
-
header h1 {}
-
-
Child Selector(์์ ์ ๋ ํฐ)
-
header > p { }
-
-
Adjacent Sibiling Selector(์ธ์ ํ์ ์ ๋ ํฐ)
-
section + p { }
-
-
Sibiling Selector(ํ์ ์ ๋ ํฐ)
-
section ~ p { }
-
- ul > li:nth-child(2n) { }
- Inside unordered list and list, choose child who is even
- section > p:nth-child(2n+1) { }
- Among child elements of section, choose child element p who is odd
- section > p:nth-last-child(2n + 1) { }
- Among child elements of section, choose child element p who is odd from the back
- p:first-of-type { }
- Choose first p element among its sibiling elements of p
- div:last-of-type { }
- choose last div element among its sibiling elements of div
- p:nth-of-type(2) { }
- choose second p element from sibiling elements of p
- p:nth-last-of-type(2) { }
- choose second last p element from sibiling elemetns of p
- p:not(#only) {}
- choose all except id is only from p elements
'TIL' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
TIL 2020.11.07 (0) | 2020.11.07 |
---|---|
TIL 2020.11.06 (0) | 2020.11.06 |
TIL 2020.11.04 (0) | 2020.11.04 |
TIL 2020.11.03 (0) | 2020.11.03 |
TIL 2020.11.02 (0) | 2020.11.02 |