Giter Club home page Giter Club logo

typescript-kr.github.io's Issues

๊ธฐ๋ณธ ํƒ€์ž…์—์„œ ํŠœํ”Œ์„ ์„ค๋ช…ํ•˜๋Š” ๋ถ€๋ถ„์— ์˜ค์—ญ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

x[3] = "world"; // ์ข‹์•„์š”, 'string'์€ 'string | number'์— ํ• ๋‹น๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๋ถ€๋ถ„์˜ ์›๋ฌธ์€

x[3] = "world"; // Error, Property '3' does not exist on type '[string, number]'

์ด๊ธฐ์—, ํ• ๋‹น๋  ์ˆ˜ ์—†๋‹ค๊ณ  ๋งํ•จ์ด ์˜ณ์Šต๋‹ˆ๋‹ค.

๊ทธ ์™ธ์—๋„

console.log(x[5].toString()); // ์ข‹์•„์š”, 'string' ๋ฐ 'number'์— ๋ชจ๋‘ 'toString'์ด ์žˆ์Šต๋‹ˆ๋‹ค.

๋ฒˆ์—ญ์˜ ์›๋ฌธ์€

console.log(x[5].toString()); // Error, Property '5' does not exist on type '[string, number]'.

์ด๊ธฐ์—, 5๋ฒˆ ์ธ๋ฑ์Šค๊ฐ€ ์—†๊ณ , ํ•ด๋‹น ์ธ๋ฑ์Šค๊ฐ€ undefined์ด๋ฏ€๋กœ toString()์„ ์“ธ ์ˆ˜ ์—†๋‹ค๊ณ  ๋ฒˆ์—ญํ•จ์ด ๋” ๋‚˜์„ ๋“ฏ ์‹ถ์Šต๋‹ˆ๋‹ค.

Tutorials/ASP.NET Core ๋ฒˆ์—ญ

  • ํŒŒ์ผ ๊ฒฝ๋กœ ๋˜๋Š” ๋งํฌ: ์›๋ฌธ
  • ์ง์ ‘ PR ํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ? (O/X):
  • ์˜ˆ์ƒ ์™„๋ฃŒ ๋‚ ์งœ:

  • ๋ฒˆ์—ญ ๋ฒ”์œ„:

Gulp ์‹ค์Šต ์ฝ”๋“œ ์•ˆ๋‚ด(Gulp 4.0 ๋Œ€์‘)

Gulp 4.0 ๋ฒ„์ „์ด ๊ธฐ๋ณธ ์„ค์น˜ ๋ฒ„์ „์œผ๋กœ ๋ณ€๊ฒฝ๋˜์–ด
์‹ค์Šต ์ฝ”๋“œ์— ์•ˆ๋‚ด๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var tsify = require('tsify');
var paths = {
    pages: ['src/*.html']
};

gulp.task('copy-html', function () {
    return gulp.src(paths.pages)
        .pipe(gulp.dest('dist'));
});

gulp.task('default', gulp.series(gulp.parallel('copy-html'), function () {
    return browserify({
        basedir: '.',
        debug: true,
        entries: ['src/main.ts'],
        cache: {},
        packageCache: {}
    })
    .plugin(tsify)
    .bundle()
    .pipe(source('bundle.js'))
    .pipe(gulp.dest('dist'));
}));

Watchify ์‹ค์Šต
npm install --save-dev watchify fancy-log

var gulp = require('gulp');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var watchify = require('watchify');
var tsify = require('tsify');
var fancy_log = require('fancy-log');
var paths = {
    pages: ['src/*.html']
};

var watchedBrowserify = watchify(browserify({
    basedir: '.',
    debug: true,
    entries: ['src/main.ts'],
    cache: {},
    packageCache: {}
}).plugin(tsify));

gulp.task('copy-html', function () {
    return gulp.src(paths.pages)
        .pipe(gulp.dest('dist'));
});

function bundle() {
    return watchedBrowserify
        .bundle()
        .on('error', fancy_log)
        .pipe(source('bundle.js'))
        .pipe(gulp.dest('dist'));
}

gulp.task('default', gulp.series(gulp.parallel('copy-html'), bundle));
watchedBrowserify.on('update', bundle);
watchedBrowserify.on('log', fancy_log);

ํŒŒ์ผ ๋นŒ๋“œ ๋ฐ ๋งํฌ ์˜ค๋ฅ˜ ํ•ด๊ฒฐ์„ ์œ„ํ•œ ์ผ€๋ฐฅ ์ผ€์ด์Šค ์ ์šฉ

#92 ์ด์Šˆ์—์„œ

๋งํฌ์— %20์ด ๋“ค์–ด๊ฐ€ ์žˆ์œผ๋ฉด gitbook ๋นŒ๋“œ์‹œ html ํŒŒ์ผ์—์„œ ์ •์ƒ์ ์œผ๋กœ ๋งํฌ๊ฐ€ ๊ฑธ๋ฆฌ์ง€ ์•Š๋Š” ์˜ค๋ฅ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
๋งํฌ ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋ฒˆ์—ญ ํŒŒ์ผ ์ด๋ฆ„ ๋ช…์„ ์ „๋ถ€ ์ผ€๋ฐฅ์ผ€์ด์Šค๋กœ ๋ณ€๊ฒฝํ•˜๋Š” ์ž‘์—…์„ ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

  • ๋ชจ๋“  ๋‹จ์–ด๋Š” ์†Œ๋ฌธ์ž๋ฅผ ์‚ฌ์šฉํ•จ
  • ๋›ฐ์–ด์“ฐ๊ธฐ๋Š” ํ•˜์ดํ”ˆ - ์œผ๋กœ ์‚ฌ์šฉ

TODO

  • ํŒŒ์ผ ์ด๋ฆ„์„ ์ผ€๋ฐฅ ์ผ€์ด์Šค๋กœ ๋ณ€๊ฒฝ
  • Summary ์ˆ˜์ •
  • ๋ฒˆ์—ญ ํŒŒ์ผ์˜ ๋งํฌ ์ˆ˜์ •
  • ๋กœ์ปฌ ํ…Œ์ŠคํŠธ

์˜ค์—ญ ์ˆ˜์ • /pages/Functions.md

ํƒ€์ž… ์ถ”๋ก  (Inferring the types)
์˜ˆ๋ฅผ ๋“ค์–ด TypeScript ์ปดํŒŒ์ผ๋Ÿฌ๋Š” ํ•œ์ชฝ์—๋Š” ํƒ€์ž…์ด ์žˆ์ง€๋งŒ ๋‹ค๋ฅธ ํ•œ์ชฝ์— ํƒ€์ž…์ด ์—†๋Š” ๊ฒฝ์šฐ ๊ทธ ํƒ€์ž…์„ ์ดํ•ดํ•  ์ˆ˜ ์—†๋‹ค๋Š” ๊ฒƒ์„ ์•Œ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค:
์ด๊ฒƒ์„ ํƒ€์ž… ์ถ”๋ก ์˜ ํ•œ ์ข…๋ฅ˜์ธ "์ƒํ™ฉ์  ํƒ€์ดํ•‘(Contextual Typing)"์ด๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ํ”„๋กœ๊ทธ๋žจ์„ ๊ณ„์† ์œ ์ง€ํ•˜๋Š” ๋ฐ ๋“œ๋Š” ๋…ธ๋ ฅ์„ ์ค„์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

->
์˜ˆ์ œ๋ฅผ ์‹คํ–‰ํ•ด๋ณด๋ฉด, ๋Œ€์ž…๋ฌธ(i.e assign)์˜ ํ•œ์ชฝ์—๋งŒ ํƒ€์ž…์ด ์žˆ๋”๋ผ๋„ TypeScript ์ปดํŒŒ์ผ๋Ÿฌ๊ฐ€ ํƒ€์ž…์„ ์ดํ•ดํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ๊ฒŒ ๋  ๊ฒ๋‹ˆ๋‹ค:
์ด๊ฒƒ์„ ํƒ€์ž… ์ถ”๋ก ์˜ ํ•œ ์ข…๋ฅ˜์ธ "์ƒํ™ฉ์  ํƒ€์ดํ•‘(Contextual Typing)"์ด๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ํ”„๋กœ๊ทธ๋žจ์„ ํƒ€์ดํ•‘ํ•˜๋Š” ๋ฐ ๋“œ๋Š” ๋…ธ๋ ฅ์„ ์ค„์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์›๋ฌธ
In playing with the example, you may notice that the TypeScript compiler can figure out the type even if you only have types on one side of the equation:
This is called โ€œcontextual typingโ€, a form of type inference. This helps cut down on the amount of effort to keep your program typed.

๋ฒ„ํŠผ ๊ฒน์นจ

๋‹ค์Œ๊ธ€๋กœ ๋„˜์–ด๊ฐ€๋Š” ๋ฒ„ํŠผ๊ณผ Fork me github ์ด๋ฏธ์ง€๋ž‘ ๊ฒน์น˜๋Š” ๋ถ€๋ถ„์ด์žˆ์–ด์„œ
github์œผ๋กœ ๋„˜์–ด์˜ฌ๋ คํ–ˆ๋Š”๋ฐ ๋‹ค์ŒํŽ˜์ด์ง€๋กœ ๋„˜์–ด๊ฐ€์„œ ์ฒ˜์Œ์—๋Š” ์˜ค๋ฅ˜์ธ์ค„์•Œ์•˜์Šต๋‹ˆ๋‹ค.

์ˆ˜์ •๋˜๋ฉด ์ข‹์„๊ฒƒ๊ฐ™์Šต๋‹ˆ๋‹ค

Edit Translation

์ฝ์„๋•Œ ์Œ์ ˆ์ด ๋งž๋Š”์ง€ ํ™•์ธ

์˜คํƒ€ ์ˆ˜์ • ์š”์ฒญ

์•ˆ๋…•ํ•˜์„ธ์š”.

typescript-kr.github.io / pages / tutorials / React & Webpack.md

์œ„ ํŒŒ์ผ์—์„œ ๋ผ์ธ 87์— ์žˆ๋Š” __์ž…์ด๋‹ค.__๋ฅผ __์ž…๋‹ˆ๋‹ค.__๋กœ ์˜คํƒ€ ์ˆ˜์ • ์š”์ฒญ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

ํŽ˜์ด์ง€๋‚ด ๋งํฌ ์˜ค๋ฅ˜

  • ๋‚ด์šฉ:
    ๋ฒˆ์—ญํ•˜๋Š๋ผ ๊ณ ์ƒ์ด ๋งŽ์œผ์‹ญ๋‹ˆ๋‹ค.

๋‹ค๋ฆ„์ด ์•„๋‹ˆ๋ผ ๋ฒˆ์—ญ๋ณธ์„ ์ž˜ ์ฝ๊ณ  ์žˆ๋Š”๋ฐ, ํŽ˜์ด์ง€๋‚ด ๊ฝค ๋งŽ์€ ๋‚ด๋ถ€๋งํฌ๊ฐ€ ๊นจ์ ธ์žˆ๋”๋ผ๊ณ ์š”.

ํŒŒ์ผ ์ด๋ฆ„ ์˜คํƒ€๋„ ์ข€ ์žˆ์—ˆ๊ณ ... ๊ทธ๋ฆฌ๊ณ  ๊ฒฐ์ •์ ์œผ๋กœ
๋งํฌ๋ฅผ ๋ณด๋ฉด *.md๋กœ ๋๋‚˜๋Š”๋ฐ, ๋งํฌ ์ฃผ์†Œ๋ฅผ *.html๋กœ ํ•ด์•ผ ํฌ๋กฌ ๋ธŒ๋ผ์šฐ์ €๋‚ด์—์„œ ์ด๋™์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

์ด๊ฒŒ ๋นŒ๋“œ ๊ณผ์ •์—์„œ ์›๋ž˜ ๋ณ€ํ™˜์‹œ์ผœ์ฃผ๋Š” ๊ฑด๋ฐ, ์•ˆ๋˜๋Š” ๊ฑด์ง€, ์•„๋‹ˆ๋ฉด ๊ทธ๋ƒฅ ๋งˆํฌ๋‹ค์šด ๋ฌธ์„œ ์ž‘์„ฑ๊ณผ์ •์—์„œ ๋‚˜์˜จ ์˜คํƒ€์ธ์ง€ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค.

๋‹ค๋งŒ, ํฌํฌํ•ด์„œ npx gitbook serve ํ•ด๋ณด๋‹ˆ๊นŒ ๋กœ์ปฌ์—์„œ๋„ ๋งํฌ๋Š” ๋‹ค ๊นจ์ ธ์žˆ๋”๋ผ๊ณ ์š”. ํํํ

๊ทธ๋ฆฌ๊ณ  ๊นƒ๋ถ ํŒจํ‚ค์ง€๋„ ์ตœ์‹  ๋ฒ„์ ผ? (3.2.3) ๋ฒ„์ ผ์œผ๋กœ ์„ค์น˜ํ•˜๋‹ˆ๊นŒ ์ค‘๊ด„ํ˜ธ ๋‘๊ฐœ ์—ฐ์†์€ ํŒŒ์‹ฑ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜๋”๋ผ๊ณ ์š”.

๋งํฌ ์˜ค๋ฅ˜๊ฐ€ ์˜คํƒ€๋ฉด ์ œ๊ฐ€ ๋˜๋Š”๋Œ€๋กœ ๊นจ์ง„ ๋ถ€๋ถ„ ์ˆ˜์ •ํ•ด์„œ ํ’€์š”์ฒญ์„ ๋‚ ๋ฆด๊นŒ ํ•ฉ๋‹ˆ๋‹ค. .

[ํ”„๋กœ์ ํŠธ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ๊ณ„ํš]

๋‚ด์šฉ

yeonjuan/TypeScript-Handbook-ko ํ”„๋กœ์ ํŠธ๋ฅผ Deprecated ์‹œํ‚ค๊ณ , ์ด ํ”„๋กœ์ ํŠธ๋กœ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ํ•˜๊ธฐ๋กœ ํ•˜์˜€์Šต๋‹ˆ๋‹ค.( Deprecated ๊ณ„ํš ์ฐธ๊ณ  )

์•„๋ž˜ ๋Œ“๊ธ€๋กœ ํ”„๋กœ์ ํŠธ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜์— ํ•„์š”ํ•œ ์ž‘์—…, ์˜๊ฒฌ์— ๋Œ€ํ•ด ๋‚จ๊ฒจ์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

ํŽธ์˜์ƒ yeonjuan/TypeScript-Handbook-ko ํ”„๋กœ์ ํŠธ๋ฅผ ์ด์ „ ํ”„๋กœ์ ํŠธ ๋ผ๊ณ  ๋ถ€๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค.

TODO

  • ๋ฒˆ์—ญ md ํŒŒ์ผ ์ด๋™ - comment / migration branch: 9977b1c, 0be6ad2
  • SUMMARY.md ์ˆ˜์ • - 5e5c45d
  • ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜์œผ๋กœ ํ•ด๊ฒฐ๋˜๋Š” ์ด ํ”„๋กœ์ ํŠธ์˜ ์ด์Šˆ๋“ค ํ™•์ธ - comment
  • ์ด์ „ ํ”„๋กœ์ ํŠธ์—์„œ ๊ฐ€์ ธ์˜ฌ ๋งŒํ•œ ๊ฒƒ๋“ค ์˜ฎ๊ธฐ๊ธฐ
    • ์ด์Šˆ ํ…œํ”Œ๋ฆฟ (60fe46f), ๋ผ๋ฒจ (์™„๋ฃŒ), ๋ฒˆ์—ญ ์šฉ์–ด์ง‘ ์œ„ํ‚ค (๋งํฌ), ๋ฒˆ์—ญ ๊ทœ์น™ (๋งํฌ), CONTRIBUTING.md (0528e1a)
  • ๋ธŒ๋žœ์น˜, ๋จธ์ง€ ๊ทœ์น™ ์„ค์ • (squash ๋จธ์ง€, ์ตœ์†Œ ๋ฆฌ๋ทฐ์–ด(2๋ช…) ์„ค์ •)
  • ์ด์ „ ํ”„๋กœ์ ํŠธ markdownlint, travis-ci ์‚ฌ์šฉ ๋…ผ์˜ ๋ฐ ์„ค์ •
  • GA ๊ด€๋ จ ๋…ผ์˜ (ํ˜„์žฌ ์„ค์ • ์‚ฌ์šฉ + ๊ณต์œ  vs ์ƒˆ๋กœ ์„ค์ •)
  • README.md ์ˆ˜์ •
  • ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ์™„๋ฃŒ(๋ฆด๋ฆฌ์ฆˆ)
  • ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜์œผ๋กœ ํ•ด๊ฒฐ๋œ ์ด์Šˆ close
  • progress.md ์—…๋ฐ์ดํŠธ - #43

functions.md ์˜คํƒ€

  • ๋‚ด์šฉ:
    let result1 = buildName("Bob"); // ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๋™์ž‘, "Bod Smith" ๋ฐ˜ํ™˜
    ์—์„œ Bod -> Bob
  • ์ง์ ‘ PR ํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ? (O/X): O

๋ฒˆ์—ญ ์ž‘์—… ์ง„ํ–‰ ์ƒํ™ฉ ๊ด€๋ฆฌ ๊ณ„ํš

๋‚ด์šฉ

@yeonjuan @guyeol @dvlprsh

๋ฒˆ์—ญ ๊ด€๋ จ ์ž‘์—… ์ง„ํ–‰ ์ƒํ™ฉ์„ ๊ณต์œ  ๋ฐ ๊ด€๋ฆฌํ•  ๋ฐฉ๋ฒ•์„ ์ •ํ•ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

  • ํ˜„์žฌ ๋ ˆํฌ์ฒ˜๋Ÿผ progress.md ํŒŒ์ผ๋กœ ์ง„ํ–‰ ์ƒํ™ฉ ๊ด€๋ฆฌ
  • ๊ธฐ์กด ๋ ˆํฌ์ฒ˜๋Ÿผ ์ด์Šˆ ํ‹ฐ์ผ“์„ ์ƒ์„ฑํ•˜๊ณ , ์ด์Šˆ ํ‹ฐ์ผ“์—์„œ ์ฒดํฌ ๋ฐ•์Šค๋กœ ๊ด€๋ฆฌ
  • ํ”„๋กœ์ ํŠธ ๋ณด๋“œ๋ฅผ ์ด์šฉํ•˜์—ฌ ์ง„ํ–‰ ์ƒํ™ฉ ๊ด€๋ฆฌ

3๊ฐ€์ง€ ์ •๋„ ์„ ํƒ์ง€๊ฐ€ ์žˆ๋Š”๋ฐ ์˜๊ฒฌ ์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค :)

Advanced Type / Nullable ๋ถ€๋ถ„์— null, undefined ๋ฅผ ๋ฐ”๋กœ ํ• ๋‹นํ• ์ˆ˜์žˆ๋Š” ๋ฌธ์ œ

Advanced Type / Nullable ํŽ˜์ด์ง€๋ฅผ ์ฝ๋‹ค๊ฐ€ ์ผ๋ฐ˜ ๋ณ€์ˆ˜์— null ์ด๋‚˜ undefined ๋ฅผ ๋ช…์‹œ์ ์œผ๋กœ ์ ์–ด์ฃผ์ง€์•Š์œผ๋ฉด ์•ˆ๋œ๋‹ค๊ณ ํ–ˆ๋Š”๋ฐ ๋ง‰์ƒ ํƒ€์ดํ•‘ํ•˜๊ณ  ์ปค๋งจ๋“œ๋ฅผ ์‹คํ–‰ํ•˜๋‹ˆ๊นŒ ์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ค๋Š”๋ฐ ๋ญ”๊ฐ€ ์ž˜๋ชป ์ดํ•ดํ•œ๊ฑธ๊นŒ์š”?

let s = "foo"
s = null // console.log(s) -> null
s = undefined // console.log(s) -> undefined

basic-types.md ์˜คํƒ€

  • ํŒŒ์ผ ๊ฒฝ๋กœ ๋˜๋Š” ๋งํฌ: https://typescript-kr.github.io/pages/basic-types.html

  • ๋‚ด์šฉ: Null and Undefined ์ ˆ์˜ note ๋ถ€๋ถ„์— ํ‚ค์›Œ๋“œ ์˜คํƒ€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
    structNullChecks -> strictNullChecks

  • ์ง์ ‘ PR ํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ? (O/X): O

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.