React ๊ณต๋ถ€ํ•˜๊ธฐ 7 - ์ปดํฌ๋„ŒํŠธ ๋ผ์ดํ”„ ์‚ฌ์ดํด

## React Component Life Cycle ๋ผ์ดํ”„ ์‚ฌ์ดํด์€ ์ด 10๊ฐ€์ง€๋‹ค. `Will`์ ‘๋‘์‚ฌ๋Š” ์–ด๋–ค ์ž‘์—…์„ ์ž‘๋™ํ•˜๊ธฐ์ „์— ์‹คํ–‰ํ•˜๋Š” ๋ฉ”์†Œ๋“œ๊ฐ€, `Did`๋Š” ์–ด๋–ค ์ž‘์—…์„ ํ•œ ํ›„์— ์‹คํ•ด์˜ค๋””๋Š” ๋ฉ”์„œ๋“œ๋‹ค. ์ด ๋ฉ”์„œ๋“œ๋“ค์€ ์ปดํฌ๋„ŒํŠธ ํด๋ž˜์Šค์—์„œ ๋ฎ์–ด์จ์„œ ์„ ์–ธํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ผ์ดํ”„์‚ฌ์ดํด์€ ์ด 3๊ฐ€์ง€ ์นดํ…Œ๊ณ ๋ฆฌ๋กœ ๋‚˜๋ˆŒ ์ˆ˜ ์žˆ๋Š”๋ฐ, `mount`, `unm...

Read

React ๊ณต๋ถ€ํ•˜๊ธฐ 6 - ์ปดํฌ๋„ŒํŠธ ๋ฐ˜๋ณต

## ์ปดํฌ๋„ŒํŠธ ๋ฐ˜๋ณตํ•ด์„œ ์“ฐ๊ธฐ ```javascript import React, {Component} from 'react'; class IterationSample extends Component { render () { const names = ['๋ˆˆ์‚ฌ๋žŒ', '์–ผ์Œ', '๋ˆˆ', '๋ฐ”๋žŒ'] const nameList ...

Read
javascript

Javascript - Promise

## Promise ```javascript new Promise(executor) ``` `executor`๋Š” `resolve`๋ฐ `reject` ์ธ์ˆ˜๋ฅผ ์ „๋‹ฌํ•  ์‹คํ–‰ํ•จ์ˆ˜๋ฅผ ์˜๋ฏธํ•œ๋‹ค. ์‹คํ–‰ํ•จ์ˆ˜๋Š” `resolve`์™€ `reject`๋ฅผ ๋ฐ›์•„ ์ฆ‰์‹œ ์‹คํ–‰๋œ๋‹ค. ์‹คํ–‰ํ•จ์ˆ˜๋Š” ๋ณดํ†ต ๋น„๋™๊ธฐ ์ž‘์—…์„ ์‹œ์ž‘ํ•œ ํ›„, ๋ชจ๋“  ์ž‘์—…์„ ๋๋‚ด๋ฉด `resolve`๋ฅผ ํ˜ธ์ถœํ•ด์„œ `Prom...

Read
javascript

Javascript - Destructuring Assignment

## ๊ตฌ์กฐ ๋ถ„ํ•ด ํ• ๋‹น ๊ตฌ์กฐ ๋ถ„ํ•ด ํ• ๋‹น์€ ๋ฐฐ์—ด์ด๋‚˜ ๊ฐ์ฒด์˜ ์†์„ฑ์„ ๋ง๊ทธ๋Œ€๋กœ ๋ถ„ํ•ดํ•˜์—ฌ, ๋ถ„ํ•ด ํ•œ ๊ฐ’์„ ๊ฐœ๋ณ„๋ณ€์ˆ˜์— ๋‹ด์„ ์ˆ˜ ์žˆ๊ฒŒ ๋„์™€์ฃผ๋Š” ํ‘œํ˜„์‹์ด๋‹ค. ```javascript let a, b, rest; [a, b] = [10, 20]; console.log(a); // 10 console.log(b); // 20 // rest ํŒจํ„ด์„ ์ด์šฉํ•˜์—ฌ ๋‚˜๋จธ์ง€๋ฅผ ๋ชจ๋‘...

Read
javascript

Javascript - Closure

## ํด๋กœ์ € ### ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋Š” ์–ด๋–ป๊ฒŒ ๋ณ€์ˆ˜์˜ ์œ ํšจ ๋ฒ”์œ„๋ฅผ ์ •ํ•˜๋Š”๊ฐ€? ```javascript function hello() { var name = "yceffort" // ๋‚ด๋ถ€ํ•จ์ˆ˜์ด๋ฉฐ, ํด๋กœ์ €๋‹ค. function showName() { // ๋ถ€๋ชจํ•จ์ˆ˜๊ฐ€ ์„ ์–ธํ•œ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. alert(`hello, ${name}`) }...

Read