JS/[드림코딩] 엘리 (완) 13

11강. Callback

'use strict'; JavaScript is synchronous. (동기적_작성순서에 따름) Execute the code block by orger after hoisting. hoisting: var, function declaration (함수 선언들이 자동적으로 가장 위로 올라감 / 코드순서대로 실행) console.log('1'); //1 //지정한 시간이 지나면 callback함수 호출 setTimeout(function(){ console.log('2'); },1000);//1초 후 browser가 출력 //간략히 setTimeout(()=> console.log('2'),1000); console.log('3'); //1,3,2 Synchronous callback function ..

10강. JSON

HTTP: hyperText Transfer Protocol _ client와 server의 소통 AJAX( Asynchronous JavaScript And XML ) - XHR( XMLHttpRequest ): 브라우저 api obj, 서버에 data요청, 수령 - fetch() API (ie X) - JSON( JavaScript Object Notation ): ECMAScript 3rd 1999 에서 영감을 받아 생성됨 - Object( key; value } - simplest data interchange format - lightweight text-based struncture - easy to read - key-value pairs - used for serialization and ..

09강. Array APIs

Q1. make a string out of an array { const fruits = ['apple', 'banana', 'orange']; const resule = fruits.join(); console.log(result); //apple.banana,orange const resule = 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); //["🍎","🥝","🍌","🍒"] c..

06강. class vs object, 객체지향 언어 클래스 정리

'use strict' class person{ name; age;//속성(field) speak();//행동(method) } class = fields + methods class: template / declare once / no data in ex) 붕어빵틀 object: instance of a class / created many times / data in ex) 팥붕어빵, 슈크림붕어빵 object-oriented programming class: template object: instance of a class javascript classes - introduced in ES6 - syntactical sugar over prototype-based inheritance 1. Class..

05강. 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 ex) createCardAndPoint -> createdcard, createPoint - function is object in JS_ 변수할당가능, parameter전달, function return o function..

04강. 코딩의 기본, operator, if, for loop, 코드리뷰 팁

1. String concatenation console.log('my'+'cat'); console.log('1'+2); console.log(`string literals: 1 +2 = ${1 + 2}`); string literals 장점_ 줄바꿈이나 중간에 ''를 이용해도 그대로 문자열로 변환됨 (\' : 문자열 \n : 줄바꿈 \t : tab) 2. Numeric operators console.log(1+1);//add console.log(1-1);//substract console.log(1*1); //multiply console.log(1/1); //divide console.log(1%1); //remainder console.log(1**1); //exponentiation 3. I..

반응형