Skip to content

Instantly share code, notes, and snippets.

@HyeYeonCha
HyeYeonCha / API.md
Created December 24, 2020 06:39 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@HyeYeonCha
HyeYeonCha / ordering-coffee-async.js
Created October 1, 2020 05:24 — forked from gotoweb/ordering-coffee-async.js
ordering-coffee-async.js
function waitAsync(callback, ms) {
setTimeout(callback, ms); // ํŠน์ • ์‹œ๊ฐ„ ์ดํ›„์— callback ํ•จ์ˆ˜๊ฐ€ ์‹คํ–‰๋˜๊ฒŒ๋” ํ•˜๋Š” ๋ธŒ๋ผ์šฐ์ € ๋‚ด์žฅ ๊ธฐ๋Šฅ์ž…๋‹ˆ๋‹ค
}
function drink(person, coffee) {
console.log(person + '๋Š” ' + coffee + '๋ฅผ ๋งˆ์‹ญ๋‹ˆ๋‹ค');
}
function orderCoffeeSync(coffee) {
console.log(coffee + '๊ฐ€ ์ ‘์ˆ˜๋˜์—ˆ์Šต๋‹ˆ๋‹ค');
@HyeYeonCha
HyeYeonCha / ordering-coffee-sync.js
Created October 1, 2020 05:22 — forked from gotoweb/ordering-coffee-sync.js
ordering-coffee-sync.js
function waitSync(ms) {
var start = Date.now();
var now = start;
while(now - start < ms) {
now = Date.now();
}
} // ํ˜„์žฌ ์‹œ๊ฐ๊ณผ ์‹œ์ž‘ ์‹œ๊ฐ์„ ๋น„๊ตํ•˜๋ฉฐ ms ๋ฒ”์œ„ ๋‚ด์—์„œ ๋ฌดํ•œ ๋ฃจํ”„๋ฅผ ๋„๋Š” blocking ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค
function drink(person, coffee) {
console.log(person + '๋Š” ' + coffee + '๋ฅผ ๋งˆ์‹ญ๋‹ˆ๋‹ค');