전체 글 275

input 현재 날짜를 기본값으로 설정하기

현재 시간을 기본값으로 설정하기 여러개일 경우 id값 구별하기 - month 타입에 현재 월 설정하기 - date 타입에 현재 일 설정하기 - time 타입에 현재 시간 설정하기 - datetime-local 타입에 현재 날짜, 시간 세팅하기 document. getElementById() : 주어진 문자열과 일치하는 id속성을 가진 요소를 찾고 element객체에 반환 document. querySelector() : id가 없는 요소 Date : 시간의 특정 지점을 나타내는 Date객체 생성 JS Date 객체 생성(초기화) : new 연산자 사용 toISOString() : 단순화한 확장 ISO형식의 문자열 반환, 반환값은 항상 24글자 또는 27글자 slice( begin, end ) : 원본 배..

그때 그때/JS 2020.09.14

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..

반응형