javascript

javascript class

# Class ํด๋ž˜์Šค๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ์ด๋ ‡๊ฒŒ ์ƒ๊ฒผ๋‹ค. ```javascript class Member { getName() { return "์ด๋ฆ„"; } } let obj = new Member(); console.log(obj.getName()); ``` ## ํŠน์ง• ### 1. strict ๋ชจ๋“œ์—์„œ ์‹คํ–‰ ๋”ฑํžˆ `'use strict'...

Read
javascript

Intersection Observer

## Intersection Observer Intersection Observer๋Š” ์—˜๋ฆฌ๋จผํŠธ๊ฐ€ viewport์— ๋…ธ์ถœ๋˜๊ณ  ์žˆ๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ด์ฃผ๋Š” API๋‹ค. ๊ฐ„๋‹จํžˆ ๋งํ•ด ๋ธŒ๋ผ์šฐ์ €์˜ ์–ด๋–ค ์š”์†Œ๊ฐ€ ํ™”๋ฉด์— ๋…ธ์ถœ๋˜๊ณ  ์žˆ๋Š”์ง€ ์•ˆ๋˜๊ณ  ์žˆ๋Š”์ง€๋ฅผ ํ™•์ธํ•ด์ฃผ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™๋‹ค. ์ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์—†์ด ์—˜๋ฆฌ๋จผํŠธ๊ฐ€ ๋…ธ์ถœ์ค‘์ธ์ง€ ํ™•์ธํ•˜๋ ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผํ• ๊นŒ? ์ด...

Read

Typescript, React, NextJs, Koa, Styled Component ๋กœ ํ”„๋ก ํŠธ์—”๋“œ ํ™˜๊ฒฝ ๋งŒ๋“ค๊ธฐ

์ด ๋ฌธ์„œ๋Š” ๋” ์ด์ƒ ์—…๋ฐ์ดํŠธ ํ•˜์ง€ ์•Š์„ ์ƒ๊ฐ์ด๋‹ค. ๋Œ€์‹  https://github.com/yceffort/koa-nextjs-react-typescript-boilerplate ์—ฌ๊ธฐ์—์„œ ๊ณ„์† ํ•ด์„œ ๋งŒ๋“ค์–ด ๊ฐ€๊ณ  ์žˆ๋‹ค. ## ์‚ฌ์šฉํ•œ ์˜คํ”ˆ์†Œ์Šค ### React ์ž์„ธํ•œ ์„ค๋ช…์€ ์ƒ๋žต ํ•œ๋‹ค ### Nextjs [NextJs](https://nextjs.org...

Read

Typescript Type, Enum, Partial, Record๋กœ ๊ธ€๋กœ๋ฒŒ ๋ณ€์ˆ˜ ๊ด€๋ฆฌํ•˜๊ธฐ

## ๊ณ ๋ฏผ์ง€์  - Global ๋กœ ๊ด€๋ฆฌํ•˜๋Š” Colorset Red, Blue, Green, Black์ด ์žˆ๋‹ค. - ์ด ์ƒ‰๋“ค์€ ๊ฐ๊ฐ ์ง€์ •๋œ ์นผ๋ผ์ฝ”๋“œ๊ฐ€ ์žˆ๋‹ค - ๊ทธ๋Ÿฌ๋‚˜ ๋•Œ๋กœ๋Š” ๊ทธ ์ปฌ๋Ÿฌ์ฝ”๋“œ์— ๋งž๊ฒŒ ์•ˆ์“ฐ๋Š” ๊ฒฝ์šฐ๋„ ์žˆ๋‹ค - ๊ทธ๋Ÿฌ๋‚˜ ๋•Œ๋กœ๋Š” ์ € ๋„ค๊ฐœ๋ฅผ ๋‹ค ์•ˆ์“ฐ๊ณ  1~3๊ฐœ๋งŒ ์“ฐ๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค. ## Union types [Union Type](https://www....

Read

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

### ํ•จ์ˆ˜ํ˜• ์ปดํฌ๋„ŒํŠธ ```javascript import React from 'react'; function Hello(props) { return ( <div>hello {props.name}</div> ) } ``` ํ•จ์ˆ˜ํ˜• ์ปดํฌ๋„ŒํŠธ๋Š” ์ปดํฌ๋„ŒํŠธ์—์„œ ๋ผ์ดํ”„์‚ฌ์ดํด, state ๋“ฑ์˜ ๊ธฐ๋Šฅ์„ ์ œ๊ฑฐํ•œ ์ƒํƒœ์ด๋ฏ€๋กœ ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰์ด...

Read