JS 67

[ codeit ] 프로그래밍 기초 in JS - 프로그래밍 핵심개념 in JS (3)

제어문 1강. if문 (if statement) //if문 (if statement) if(조건부분){ 동작부분 } let temperature = 0; if(temperature = LIMIT) { console.log(passMessage); } else { console.log(failMessage); } } 유지보수를 위해 140을 변수화해주기 3강. else if문 //if문 (if statement) let temperature = -105; if(temperature = B_SCORE){ console.log('B'); } else if ( totalScore >= C_SCORE){ console.log('C'); } else if ( totalScore >= D_SCORE){ console..

[ codeit ] 프로그래밍 기초 in JS - 프로그래밍 핵심개념 in JS (2)

추상화 1강. 할당 연산자 //할당 연산자 (Assignment operators) let name = '코드잇'; let x = 5; x = x - 2; console.log(x); //3 2. 복합 할당 연산자 복합 할당 연산자(Compound assignment operators) : 할당 연산자와 결합하여 더 간략하게 사용가능 //같은 식 x = x + 1; x += 1; 증가(increment), 감소(decrement) 연산자 : 1씩 증가, 감소시킬 때 더 간략히 사용가능 //모두 같은 식 x = x + 1; x += 1; x++; 3. 함수의 실행 순서 //함수정의 function sayHello(){ console.log('Hello'); console.log('Welcome to Cod..

[ codeit ] 프로그래밍 기초 in JS - 프로그래밍 핵심개념 in JS (1)

자료형 1강. 숫자형 //덧셈 console.log(1 + 8); //9 //뺄셈 console.log(6 - 7); //-1 //곱셈 console.log(2 * 2); //4 //나눗셈 console.log(5 / 2); //2.5 //나머지 console.log(7 % 3); //1 //참고: 몫 구하기 const a = Math.trunc(4/3) console.log(typeof a, a) //거듭제곱 console.log(2 ** 3); //8 (= 2의 3승); //사칙연산 순서 console.log(2 + 3 * 2); //8 console.log((2+3) * 2); //10 2강. 숫자 연산 익히기 우선순위 () > ** > *, / > +, - 3강. 문자열 기본 console.log..

[ codeit ] 프로그래밍 기초 in JS - 프로그래밍 시작하기 in JS

자바스크립트 첫 걸음 1강. 자바스크립트 프로그래밍? 웹사이트를 만들고싶다면 반드시 배워야하는 프로그래밍 언어, web을 넘어 다양한 분야에 활용 1989년 웹의 첫 등장, 90년대 보편화 JS의 다양한 활용 언어의 문법 x 프로그래밍의 원리 o 2강. 준비하기 VSCode 3강. Hello Codeit! Ctrl S 저장하기 Ctrl O 불러오기 4강. 프로그래밍 첫걸음 떼기 console.log(15) 프로그래밍 맛보기 1강. 세미콜론 문장이 끝났다는 의미, 예상치못한 오류방지 2강. 코멘트 // 주석 comment /* 여러줄 주석입니다. */ 어떤 의도로 코드가 작성되었는지 설명할 때, 구현한 코드가 어떤 동작을 하는지 기록할 때 3강. 자료형 개요 프로그래밍이란? 컴퓨터로 복잡한 계산을 하는 것..

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

반응형