노마드코더

    Objects [설명이 필요한 정보가 담긴 데이터 리스트들]

    Objects [설명이 필요한 정보가 담긴 데이터 리스트들]

    Object 목적: 의미가 있는(설명) property를 가진 데이터를 저장하도록 그룹화해준다. Object 기본 및 결과 const playerName = "nico"; const playerPoints = 121212; const playerHandsome = false; const playerFat = "little bit"; const player = ["nico", 1212, false, "little bit"]; 이 복잡한 나열을 최선의 방법으로 정리하고 싶을 때, 같은 방법 1. console.log(player.name); 2. console.log(player["name"]); Object를 업데이트하고 싶을 때 const player = { name: "nico", points: 10,..

    Array [설명이 필요하지 않은 데이터 리스트들]

    Array [설명이 필요하지 않은 데이터 리스트들]

    array 목적: 하나의 variable안에 데이터의 list를 가져오는 것!!! array 기본 console.log추출방법 1. const mon = "mon"; const tue = "tue"; const wed = "wed"; const thu = "thu"; const fri = "fri"; const sat = "sat"; const sun = "sund"; const daysOfWeek = [mon, tue, wed, thu, fri, sat, sun]; console.log(daysOfWeek); 2. const daysOfWeek = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]; console.log(daysOfWeek); 위2가지 방법으로 같..

    Booleans(true,false,null, undefined)

    Boolean이란? : Variable타입의 한 종류 const a = 5 const b = "hello" 변수 a 를 불러오면 숫자 5가 나오게 되고 이 변수의 타입은 Number 라고 하고, 변수 b 를 불러오면 문자 hello 가 나오고, 이 변수의 타입은 String 이라고 한다. 이처럼 변수 값에 숫자도 문자도 아닌 true 혹은 false 값을 정해주고 변수를 불러왔을 때 나오는 값의 타입을 Boolean 이라고 하는 것이다. 1. true =/= "true" : ----> 컴퓨터 1처럼 켜져있음.(On) 2. false =/= "false" : ----> 컴퓨터 0처럼 꺼져있음.(Off) 3. null = 값이 "없음"("비어있어요!") : 변수에 아무것도 없음. null =/= undefi..

    Variable을 만드는 방법(const,let,var)

    Variable을 만드는 방법(const,let,var)

    Variable을 만드는 방법 1. const - variable을 통해 코드를 간결하게 (값 can't change.) 상수, 생성 후 바꿀 수 없음 const a = 5; const b = 2; const myName = "jiyoung" console.log(a + b); console.log(a * b); console.log(a / b); console.log("hello " + myName); * const 는 한번 선언된 변수를 중간에 재선언을 통해 수정 할 수 없는 단호박 같은 친구다. 2. let - 새로운 것을 생성할 때 사용함. (값 can change.) 생성할 때 사용, 생성 후에 값을 바꿀 수 있음. 재선언 X, 재할당 O const a = 5; const b = 2; let m..