๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ฌ

(50)
25์ผ์ฐจ ๐Ÿคก 25์ผ์ฐจ Part 4. TypeScript Essentials Ch 3. Type System Ch 4. TypeScript Compiler Ch 3. Type System ๐Ÿ”— nolmplicitAny ์˜ต์…˜์„ ์ผœ๋ฉด ํƒ€์ž…์„ ๋ช…์‹œ์ ์œผ๋กœ ์ง€์ •ํ•˜์ง€ ์•Š์€ ๊ฒฝ์šฐ, ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์ถ”๋ก  ์ค‘ any ๋ผ๊ณ  ํŒ๋‹จํ•˜๊ฒŒ ๋˜๋ฉด, ์ปดํŒŒ์ผ ์—๋Ÿฌ๋ฅผ ๋ฐœ์ƒ์‹œ์ผœ ๋ช…์‹œ์ ์œผ๋กœ ์ง€์ •ํ•˜๋„๋ก ์œ ๋„ํ•œ๋‹ค. ๐Ÿ”— strictNullChecks ์˜ต์…˜์„ ์ผœ๋ฉด ๋ชจ๋“  ํƒ€์ž…์— ์ž๋™์œผ๋กœ ํฌํ•จ๋˜์–ด ์žˆ๋Š” null ๊ณผ undefined ๋ฅผ ์ œ๊ฑฐํ•ด์ค€๋‹ค. ๐Ÿ”— noImplicitReturns ์˜ต์…˜์„ ์ผœ๋ฉด ํ•จ์ˆ˜ ๋‚ด์—์„œ ๋ชจ๋“  ์ฝ”๋“œ๊ฐ€ ๊ฐ’์„ ๋ฆฌํ„ดํ•˜์ง€ ์•Š์œผ๋ฉด, ์ปดํŒŒ์ผ ์—๋Ÿฌ๋ฅผ ๋ฐœ์ƒ์‹œํ‚จ๋‹ค. ๐Ÿ”— Structural Type System vs Nominal Type System Struc..
24์ผ์ฐจ ๐Ÿฆ„ 24์ผ์ฐจ Part 4. TypeScript Essentials Ch 1. TypeScript Ch 2. Basic Types Ch1. TypeScript Typescript๋Š” ์œ ํ˜•์„ ์ถ”๊ฐ€ํ•˜์—ฌ JavaScript๋ฅผ ํ™•์žฅํ•œ๋‹ค. Typescript๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์ „์— ์˜ค๋ฅ˜๋ฅผ ํฌ์ฐฉํ•˜๊ณ  ์ˆ˜์ • ์‚ฌํ•ญ์„ ์ œ๊ณตํ•˜๋Š” ์‹œ๊ฐ„์„ ์ ˆ์•ฝํ•  ์ˆ˜ ์žˆ๋‹ค. ๐Ÿ”— ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์ปดํŒŒ์ผ๋Ÿฌ๋ฅผ ๊ธ€๋กœ๋ฒŒ๋กœ ์„ค์น˜ ํ›„, // ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์ปดํŒŒ์ผ๋Ÿฌ ๊ธ€๋กœ๋ฒŒ ์„ค์น˜ $ npm i typescript -g // cli ๋ช…๋ น์–ด๋กœ ํŒŒ์ผ ์ปดํŒŒ์ผ $ tsc test.ts // ํŠน์ • ํ”„๋กœ์ ํŠธ ํด๋”์—์„œ ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์ปดํŒŒ์ผ๋Ÿฌ ์„ค์ •์— ๋งž์ถฐ ์ปดํŒŒ์ผ $ tsc --init $ tsc ๐Ÿ”— ํ”„๋กœ์ ํŠธ์— ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์ปดํŒŒ์ผ๋Ÿฌ๋ฅผ ์„ค์น˜ ํ›„, // ํ”„๋กœ์ ํŠธ์— ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์ปดํŒŒ์ผ..
23์ผ์ฐจ ๐Ÿช… 23์ผ์ฐจ Part 4. JavaScript Level up Ch 3. ์ •๊ทœํ‘œํ˜„์‹ Ch 3. ์ •๊ทœํ‘œํ˜„์‹ ๋‚ด์šฉ ๐Ÿ”— ์ •๊ทœ์‹ ์ƒ์„ฑ https://heropy.blog/2018/10/28/regexp/ ์ •๊ทœํ‘œํ˜„์‹, ์ด๋ ‡๊ฒŒ ์‹œ์ž‘ํ•˜์ž! ๋งค์ผ ์“ฐ๋Š” ๊ฒƒ๋„, ๊ฐ€๋…์„ฑ์ด ์ข‹์€ ๊ฒƒ๋„ ์•„๋‹ˆ์ง€๋งŒ, ๋ชจ๋ฅด๋ฉด ์•ˆ๋˜๋Š” ์ •๊ทœํ‘œํ˜„์‹. ์ €๋Š” ์ด๋ ‡๊ฒŒ ๊ณต๋ถ€ํ•˜๊ธฐ ์‹œ์ž‘ํ–ˆ์Šต๋‹ˆ๋‹ค! (์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค) heropy.blog # ์ •๊ทœํ‘œํ˜„์‹ (RegExp) ์ •๊ทœ์‹, Regular Expression ## ์—ญํ•  - ๋ฌธ์ž ๊ฒ€์ƒ‰(search) - ๋ฌธ์ž ๋Œ€์ฒด(replace) - ๋ฌธ์ž ์ถ”์ถœ(extract) ## ํ…Œ์ŠคํŠธ ์‚ฌ์ดํŠธ https://regexr.com/ RegExr: Learn, Build, & Test RegEx RegExr is an ..
22์ผ์ฐจ ๐Ÿธ 22์ผ์ฐจ Part 4. JavaScript Level up Ch 2. JS ๋ฐ์ดํ„ฐ ์‹ค์Šต Ch 2. JS ๋ฐ์ดํ„ฐ ์‹ค์Šต ๋‚ด์šฉ ๐Ÿ”— ๊ฐ€์ ธ์˜ค๊ธฐ, ๋‚ด๋ณด๋‚ด๊ธฐ // main.js import _ from "lodash"; import checkType from "./getType"; // import { random, user as heropy } from "./getRandom"; import * as R from "./getRandom"; console.log(_.camelCase("the hello world")); console.log(checkType([1, 2, 3])); // console.group(random(), random()); console.log(R); // getRandom.js // d..
21์ผ์ฐจ ๐Ÿ“ฆ 21์ผ์ฐจ Part 4. JavaScript Level up Ch 1. JS ๋ฐ์ดํ„ฐ Ch 1. JS ๋ฐ์ดํ„ฐ ์ฃผ์ œ JS ๋ฌธ๋ฒ• ์ฃผ์š” ๋‚ด์šฉ ๐Ÿ”— ๊ฐ์ฒด ์ •์ (static) ๋ฉ”์†Œ๋“œ: prototype์ด ๋ถ™์–ด ์žˆ์ง€ ์•Š๋Š” ๋ฉ”์†Œ๋“œ => ์‹ค์ œ ๋ฐ์ดํ„ฐ ๊ฐ์ฒด์— ์ง์ ‘ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋‹ค. object.assign(target, sources): ํ•˜๋‚˜ ์ด์ƒ์˜ ์ถœ์ฒ˜ ๊ฐ์ฒด(sources)๋กœ๋ถ€ํ„ฐ ๋Œ€์ƒ ๊ฐ์ฒด(target)๋กœ ์†์„ฑ์„ ๋ณต์‚ฌ const userAge = { // key: value name: "Yujin", age: 23, }; const userEmail = { name: "Yujin", email: "yujinny00@gmail.com", }; const target = Object.assign({}, userAge); c..
20์ผ์ฐจ ๐Ÿ‘ฉ‍๐Ÿš€ 20์ผ์ฐจ Part 4. JavaScript Level up Ch 1. JS ๋ฐ์ดํ„ฐ Ch 1. JS ๋ฐ์ดํ„ฐ ์ฃผ์ œ JS ๋ฌธ๋ฒ• ์ฃผ์š” ๋‚ด์šฉ ๐Ÿ”— ๋ฌธ์ž https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/String String - JavaScript | MDN String ์ „์—ญ ๊ฐ์ฒด๋Š” ๋ฌธ์ž์—ด(๋ฌธ์ž์˜ ๋‚˜์—ด)์˜ ์ƒ์„ฑ์ž์ž…๋‹ˆ๋‹ค. developer.mozilla.org string.prototype.indexOf(str): ์ฃผ์–ด์ง„ ๊ฐ’ str๊ณผ ์ผ์น˜ํ•˜๋Š” ์ฒซ ๋ฒˆ์งธ ์ธ๋ฑ์Šค ๋ฐ˜ํ™˜ string.prototype.slice(startIndex, endIndex): ์ธ๋ฑ์Šค startIndex๋ถ€ํ„ฐ endIndex-1 ๊นŒ์ง€์˜ ๋ฌธ์ž์—ด ๋ฐ˜ํ™˜ str..
ใ…ใ……ใ…Œใ…‹ใ…ใ…… ์ฑŒ๋ฆฐ์ง€ ์‹คํŒจํ–ˆ๋“œ์•„,,,,,,,,, ๋”ฐํํ‘,,,,,,,,,,,,,,,, ๐Ÿ˜‚๐Ÿคฃ๐Ÿ˜…๐Ÿ˜ฅ๐Ÿ˜“๐Ÿ˜ข๐Ÿ˜ญ๐Ÿ˜ฒ๐Ÿ˜จ๐Ÿ˜ฐ๐Ÿ˜ฑ๐Ÿฅถ๐Ÿ’ฆ๐Ÿ’ฆ๐Ÿ’ฆ .......๋šœ๋‘ฅ........ ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ใ…‹ ์ œ์ฃผ๋„์— ์žˆ๋‹ค๊ฐ€ ์ด ๋ฌธ์ž ๋ณด๊ณ  ์ด๊ฒŒ ๋ฌด์Šจ์ผ์ด์•ผ ใ… ใ… ใ… ใ… ใ… ใ… ใ…  ํ•˜๊ณ  ๋†€๋žฌ๋‹ค 1. 500์ž ์ฑ„์šด๋‹ค๊ณ  ๋งค์ผ ์—…๋กœ๋“œ ํ•  ๋•Œ ๋งˆ๋‹ค ๊ธ€์ž์ˆ˜ ์„ธ๊ธฐ ์‚ฌ์ดํŠธ์—์„œ ํ™•์ธํ–ˆ๋Š”๋ฐ ์ž˜๋ชปํ•œ ์ ์ด ์žˆ์—ˆ๋‚˜๋ณด๋‹ค.... 2. ๋ฏธ๋ฆฌ 10์ผ์ฐจ ๊ธ€์„ ์ž‘์„ฑ ํ•ด๋†จ์—ˆ๋Š”๋ฐ ํ•ด๋‹น ๋‚ ์— ์—…๋กœ๋“œ ํ•˜๋Š” ๊ฑธ ๊นŒ๋จน๊ณ  ๋‹ค์Œ ๋‚  ์ƒˆ๋ฒฝ 1์‹œ์— ์—…๋กœ๋“œ ํ–ˆ๋Š”๋ฐ ์ด๋ ‡๊ฒŒ ์นผ๊ฐ™์ด ์ฒดํฌ ํ•˜์‹œ๋Š” ์ค„ ๋ชฐ๋ž๋‹ค ใ„ดใ…‡ใ„ฑ ๋‚˜์˜ ํฐ ์ฐฉ๊ฐ์ด๊ณ  ๋ถˆ์ฐฐ์ด์—ˆ๋‹ค............... ํ•˜ํ•˜ํ•˜ํ•˜ใ…ํ•˜ ๋„ˆ๋ฌด ์•„์‰ฝ์ง€๋งŒ ใ… ใ… ใ… ใ… ใ… ใ… ใ… ใ… ใ…  1์ผ์ฐจ ๊ธ€์—์„œ ์“ด ๊ฒƒ ์ฒ˜๋Ÿผ ์ด ์ฑŒ๋ฆฐ์ง€์— ์ฐธ์—ฌํ•œ ๊ฐ€์žฅ ํฐ ๋ชฉ์ ์ด ํ™˜๊ธ‰๋น„ ๋ณด๋‹ค๋Š” ๋งค์ผ ๊ณต๋ถ€ํ•œ ๊ฑธ ๊ธฐ๋กํ•˜๊ณ  ์ •๋ฆฌํ•˜๋ฉด ๋„์›€์ด ๋งŽ์ด ๋  ๊ฑฐ ๊ฐ™์•„์„œ ์‹œ์ž‘ํ•œ ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ๊ฐ•์˜ ๋“ค์œผ๋ฉด์„œ ๋ธ”๋กœ๊ทธ๋Š” ๊ณ„์† ํฌ์ŠคํŠธ๋ฅผ ์˜ฌ๋ฆด ์˜ˆ..
ํŒจ์ŠคํŠธ์บ ํผ์Šค ์ฑŒ๋ฆฐ์ง€ 19์ผ์ฐจ ๐Ÿฃ 19์ผ์ฐจ Part 3. JavaScript Essentials Ch 3. JS ํ•จ์ˆ˜ ch 4. JS ํด๋ž˜์Šค Ch 3. JS ํ•จ์ˆ˜ ์ฃผ์ œ ํ•จ์ˆ˜ ๊ธฐ๋ณธ ๋ฌธ๋ฒ• ์ฃผ์š” ๋‚ด์šฉ ํ•จ์ˆ˜๊ฐ€ ํ˜ธ์ถœ๋˜๋Š” ํšŸ์ˆ˜๋ฅผ ์ตœ๋Œ€ํ•œ ์ค„์ธ๋‹ค. ๐Ÿ”— ํ™”์‚ดํ‘œ ํ•จ์ˆ˜ => ํ•จ์ˆ˜ ์ตœ์†Œํ™”! const double = function (x) { return x * 2; }; console.log("double", double(7)); // const doubleArrow = (x) => { // return x * 2; // }; const doubleArrow = x => x * 2; // const doubleArrow = x => ({ // name: "yujin", // }); console.log("doubleArrow", doubleArrow(7..