IT/WILT

What I've Learned Today
IT/WILT

[JavaScript] 11. 비동기 처리의 시작, 콜백 이해하기

1. Synchronous(동기) - JavaScript is synchronous. - 현재 실행 중인 코드가 완료된 후 다음 코드를 실행한다. - Execute the code block in order after hoisting. 2. Asynchronous(비동기) - 현재 실행 중인 코드의 완료 여부와 무관하게 즉시 다음 코드로 넘어가서 실행한다. 'use strict'; console.log('1'); setIimeout(function() { console.log('2'); }, 1000); // 1초 뒤에 callback function을 실행해라. console.log('3'); // 1 3 2 setTimeout(() => console.log('4'), 1000); // Arrow f..

IT/WILT

[JavaScript] 10. JSON

1. HTTP(Hypertext Transfer protocal) - 브라우저 위에서 동작하고 있는 웹사이트나 웹어플리케이션과 같은 Client들이 어떻게 Server와 통신할 수 있는지를 정의한 것이다. - Hypertext를 서로 어떻게 주고받을 수 있는지를 규약한 Protocal의 하나이다. - XML과 JSON 등의 다양한 파일 포맷으로 주고받는다. 1-1. AJAX(Asynchronous JavaScript And XML) - HTTP를 이용해서 서버에게 데이터를 요청해서 받아올 수 있는 방법. - 웹페이지에서 동적으로 서버와 데이터를 주고받을 수 있는 기술. - ex) XHR(XMLHttpRequest) : 브라우저 API에서 제공하는 Object 1-2. XML(eXtensible Marku..

IT/WILT

[JavaScript] 9. Array API

1. join - make a string out of an array. - join(separator?: string): string; 'use strict'; const fruits = ['apple', 'banana', 'orange']; const result = fruits.join(','); console.log(result); // apple, banana, orange 2. split - make an array out of a string. - split(separator: string | RegExp, limit?: number): string[]; const fruits = 'apple, banana, orange'; const result1 = fruits.split(','); co..

IT/WILT

[JavaScript] 8. Array

1. Array Declaration 'use strict'; 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 3. Looping over an array for (let i = 0; i < fruits.length; i++) { // for console..

IT/WILT

[JavaScript] 7. Object

1. Literals & Properties - One of the JavaScript's data types. - a collection of related data and/or functionality. - Nearly all objects in JavaScript are instances of Object. - object = {key: value}; 'use strict' const obj1 = {}; // 'object literal' syntax const obj2 = new Object(); // 'object constructor' syntax function print(person) { console.log(person.name); console.log(person.age); } cons..

KimCookieYa
'IT/WILT' 카테고리의 글 목록