코딩

코딩/JavaScript

07/18 함수,객체 + Getter,Setter

/*----------------------------------------------------함수---------------------------------------------------------------*/ function hello(name) { console.log('Hello,' + name + '!'); } hello('sangju'); //ES6 템플릿 리터널 문법 // 중요 * 작은따옴표 ' (Single quote) 대신에 ~와 같이 적혀진 백틱 ` (Grave accent)를 사용해야함 function hello2(name) { console.log(`Hello, ${name}!`); } hello2('sangju'); //화살표 함수 const add = (a, b) => { ..

코딩/JavaScript

07/18 JavaScript 연산자

비교 연산자 == 과 ===의 차이 ==는 타입검사까지 하지않는다. ===는 타입검사까지 함 // let은 변수-> 재할당 바로 가능한놈 데이터 변경가능 // const는 상수-> 안바뀌는놈 재할당 x 데이터 변경 x const test = 1; console.log(test); const arr = [1, 2, 3]; arr[0] = 10; console.log(arr); //return [10,2,3] console.log(...arr); //return 10 2 3 //babel이 최신버전을 구버전으로 바꾸는거 const a = "1"; const b = 1; console.log(a == b); //return true console.log(a === b); //return false const ..

김상주
'코딩' 카테고리의 글 목록