본문 바로가기 메뉴 바로가기

kingsubin

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

kingsubin

검색하기 폼
  • 분류 전체보기 (470)
    • Java (35)
    • Spring (18)
    • JavaScript & TypeScript (23)
    • HTML & CSS (2)
    • Database (3)
    • DevOps (8)
    • CS (13)
    • Algorithm (10)
    • etc (19)
    • PS (228)
      • boj (156)
      • programmers (52)
      • etc (19)
      • leetcode (1)
    • 책 (98)
      • 이펙티브자바 (50)
      • 모던 자바스크립트 딥다이브 (24)
      • misc (14)
      • 독서 (10)
    • 일상 (10)
  • 방명록

드림코딩 (10)
11. Promise

Promise is a JavaScript object for asynchronous operation state: pending -> fulfilled or rejected Producer vs Consumer 1. Producer when new Promise is created, the executor runs automatically const promise = new Promise((resolve, reject) => { // doing some heavy work (network, read files) console.log('doing something....'); setTimeout(() => { // resolve('ellie'); reject(new Error('no network'));..

JavaScript & TypeScript 2020. 11. 15. 15:22
10. Callback

JavaScript is synchronous Execute the code block in order after hoisting hoisting : var, function declaration console.log('1'); setTimeout(() => console.log('2'), 1000); console.log('3'); // 1, 3, 2 Synchronous callback function printImmediately(print) { print(); } printImmediately(() => console.log('hello')); Asynchronous callback function printWithDelay(print, timeout) { setTimeout(print, time..

JavaScript & TypeScript 2020. 11. 15. 14:28
9. JSON

JSON (JavaScript Object Notation) simplest data interchange format lightweight text-based structure easy to read key - value pairs used for serialization and transmission of data between the network and the network connection independent programming language and platform 1. Object to JSON stringify (obj) let json = JSON.stringify(true); console.log(json); // true json = JSON.stringify(["apple", ..

JavaScript & TypeScript 2020. 11. 15. 13:21
8. Array APIs

Quiz // Q1. make a string out of an array const fruits = ['apple', 'banana', 'orange']; const result = fruits.join(); console.log(result); // 'apple,banana,orange' // Q2. make an array out of a string const fruits = '🍎, 🥝, 🍌, 🍒'; const result = fruits.split(','); console.log(result); // ["🍎", " 🥝", " 🍌", " 🍒"] // Q3. make this array look like this: [5, 4, 3, 2, 1] const array = [1, 2, 3, 4, 5]; ..

JavaScript & TypeScript 2020. 11. 14. 14:24
7. Array, API

Array 1. Declaration const arr1 = new Array(); const arr2 = [1, 2]; 2. Index position const fruits = ['apple', 'banana']; console.log(fruits); // 'apple', 'banana' console.log(fruits.length); // 2 console.log(fruits[0]); // 'apple' console.log(fruits[1]); // 'banana' console.log(fruits[2]); // undefined console.log(fruits[fruits.length - 1]); // 'banana' 3. Looping over an array print all fruits..

JavaScript & TypeScript 2020. 11. 14. 14:17
5. class vs object

class template declare once no data in introduced in ES6 syntactical sugar over prototype-based inheritance 1. class declarations class Person { // constructor constructor (name, age) { // fields this.name = name; this.age = age; } // methods speak() { console.log(`${this.name}: hello! `); } } const ellie = new Person('ellie', 20); console.log(ellie.name); // ellie console.log(ellie.age); // 20 ..

JavaScript & TypeScript 2020. 11. 14. 11:06
4. Arrow Function

Function fundamental building block in the program subprogram can be used multiple times performs a task or calculates a value 1. Function declaration function name(param1, param2) { body ... return; } one function === one thing naming: doSomething, command, verb e.g.createCardAndPoint ->. createCard, createPoint function is object in JS function printHello() { console.log('Hello'); } printHello..

JavaScript & TypeScript 2020. 11. 13. 18:04
3. operator, if, for loop

1. String concatenation console.log('my' + ' cat'); // my cat console.log('1' + 2); // 12 console.log(`string literals: 1 + 2 = ${1 + 2}`); // 1 + 2 = 3 2. Numeric operators console.log(1 + 1); // add : 2 console.log(1 - 1); // substract : 0 console.log(1 / 1); // divide : 1 console.log(1 * 1); // multiply : 1 console.log(5 % 2); // remainder : 1 console.log(2 ** 3); // exponentiation : 8 3. Inc..

JavaScript & TypeScript 2020. 11. 13. 17:40
이전 1 2 다음
이전 다음
링크
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
TAG
  • GCP
  • HTTP 완벽 가이드
  • 패스트캠퍼스 컴퓨터공학 완주반
  • 프로그래머스
  • REST API
  • 드림코딩
  • 프로그래머스 SQL
  • 이펙티브자바
  • Spring Security
  • 모던자바스크립트
  • dreamcoding
  • 이펙티브자바 스터디
  • js api
  • BOJ
  • 가상 면접 사례로 배우는 대규모 시스템 설계 기초
  • js promise
  • js array
  • 김영한 JPA
  • JS 딥다이브
  • 킹수빈닷컴
  • http
  • 김영한 http
  • java
  • 이펙티브자바 아이템60
  • HTTP 완벽가이드
  • 이펙티브자바 아이템59
  • 집 구하기
  • JPA 연관관계 매핑
  • 백준
  • 백기선 스터디
more
«   2023/10   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바