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

+ Recent posts