JavaScript - let, const, var, Array, Object
Variable
variable : something that can be changed
let
- expression이 끝나는 경우 : 
;세미콜론 - 변수선언은 CamelCase
 
- Create variable
 - Initialize
 - Use
 
let a = 221; //initialize
let b = a - 5;
a = 4;
console.log(b, a);
let: 변수초기화와 생성시 let을 쓴다.
const
const : cannot change the value 상수
var
var : const 와 let의 구분이 없었을 때 썼던..type
보통 변수를 사용할 때 let, const 를 쓰도록합시다 Never use it
comment
// : 주석
/* */ : multi line comments
Data Types on JS
디폴트로 항상 const로 변수를 선언할 것
- string
 
// string
const what = "JavaScript";
console.log(what);
- boolean
    
// boolean const b1 = true; const b2 = false; - Float
    
// float const f1 = 55.555; - JS 에서는 
''와""의 차이가 없음const a = 'hello'; const b = "hello"; console.log(a == b); //true 
Array
Array
[]: store data in list way (grouping)
It’s a way to store data on a list format
- Array 내부적으로 데이터 타입 섞어서 선언및 초기화 가능
 
const daysOfWeek = ["Mon", "Tue", "Wed", "Thu", "Fri"];
console.log(daysOfWeek);
console.log(daysOfWeek[2]); //Wed
const a = 11;
const packageArray = ["A", true, 123, a];
console.log(packageArray);
Object
Object
{}: store and organize data
It’s a way to store information on a key-value format
const myInfo = {
  name: "Jay",
  age: 33,
  gender: "Female",
  isSmart: true,
  favMovies: ["LOTR","HarryPotter"],
  favFood: [
    {
      name: "Kimchi",
      fatty: false
    }, 
    {
      name: "Cheese burger",
      fatty: true
    }
  ]
};
console.log(myInfo);
console.log(myInfo.gender);
console.log(myInfo.favFood[1].fatty);
myInfo.age = 55;
console.log(myInfo.age);