Skip to content

Quiz 1, ES5

Thomas edited this page Jun 12, 2019 · 1 revision

μžλ°”μŠ€ν¬λ¦½νŠΈλŠ” Case Sensitivity ν•˜μ§€ μ•Šμ€ μ–Έμ–΄ μž…λ‹ˆλ‹€. λ§žμŠ΅λ‹ˆκΉŒ?

\u0020, \u0009, \u000A, \u000D 에 λŒ€ν•΄ μ•„λŠ”λ°λ‘œ μ„€λͺ…ν•˜μ„Έμš”.

μžλ°”μŠ€ν¬λ¦½νŠΈμ— 주석을 μ‚¬μš©ν•˜λŠ” 방법에 λŒ€ν•΄ μ„€λͺ…ν•˜μ„Έμš”.

μžλ°”μŠ€ν¬λ¦½νŠΈμ—λŠ” μ˜ˆμ•½μ–΄κ°€ μžˆμŠ΅λ‹ˆλ‹€. μ•Œκ³  μžˆλŠ” μ˜ˆμ•½μ–΄λ₯Ό 5κ°œμ΄μƒ μž‘μ„±ν•˜μ„Έμš”.

var book = {
  title: "Speaking Javascript",
  fat: true
};

μœ„μ™€ 같은 μ˜€λΈŒμ νŠΈκ°€ μ„ μ–Έν•˜κ³ . book였브젝트 μ•ˆμ—μžˆλŠ” κ°’ "Speaking Javascript"κ°€ λ‚˜μ˜€λ„λ‘ ν•˜μ„Έμš”. (단, alert에 λ¬Έμžμ—΄μ„ 직접쓰면 μ•ˆλ©λ‹ˆλ‹€.)

Number둜 μ‚¬μš©ν•  수 μžˆλŠ” κ°€μž₯ 큰수λ₯Ό κ΅¬ν•˜μ‹œμ˜€. (Number.?)

var primes = [2, 3, 5, 7];

primes의 μ•„μ΄ν…œλ“€ μ€‘μ—μ„œ κ°€μž₯ 큰수λ₯Ό κ΅¬ν•˜λŠ” ꡬ문을 μž‘μ„±ν•˜μ„Έμš”. (Mathλ₯Ό 이용)

data[0][1].name = "j";
data[1][1].qty = 20;
data[0][0].name = "tom";

μœ„μ™€ 같은식을 μΆ©μ‘±ν•˜λŠ” Object dataλ₯Ό JSONν˜•μ‹μœΌλ‘œ μž‘μ„±ν•˜μ‹œμ˜€.

였늘 λ‚ μ§œμ™€ ν˜„μž¬ μ‹œκ°„μ„ yyyy-mm-dd hh:mi:ss 둜 μ½˜μ†”μ°½μ— 좜λ ₯ν•˜μ„Έμš”.

["λ‚˜λŠ” "정말" '잘' μƒκ²Όμ–΄μš” ('--')"] λ₯Ό alert 창에 좜λ ₯μ‹œν‚€μ‹œμ˜€. (λͺ¨λ“  λ”°μ˜΄ν‘œκ°€ λ‹€ λ“€μ–΄κ°€μ•Ό ν•©λ‹ˆλ‹€.)

var s = "CHEQUER" μ—μ„œ λ§ˆμ§€λ§‰ 4번째 문자 λΆ€ν„° 6번째 λ¬ΈμžκΉŒμ§€ μ½˜μ†”μ°½μ— 좜λ ₯μ‹œν‚€μ‹œμ˜€.

var s = "CHEQUER" μ—μ„œ λ§ˆμ§€λ§‰ 2번째 λ¬Έμžμ—μ„œλΆ€ν„° λ‹€μŒ 2κΈ€μžκΉŒμ§€ μ½˜μ†”μ°½μ— 좜λ ₯μ‹œν‚€μ‹œμ˜€.

var s = "Today : $y, $m, $d" λ₯Ό "Today : 2019, 6, 11"둜 μΉ˜ν™˜ν•˜λŠ” ꡬ문을 λ§Œλ“œμ‹œμ˜€.

!(undefined) == true μ˜κ²°κ³ΌλŠ” λ¬΄μ—‡μΈκ°€μš”?

var n = 1;

n = 10 + n++;
n = n--;

n은 λͺ‡μΈκ°€μš”?

var x = 1;
var y = x ? 0 ? 1 : 9 : 0;

y의 값은 μ–Όλ§ˆ μΈκ°€μš”?

Clone this wiki locally