[JS_오답노트]_기본형이란?

hanseungjune·2022년 5월 31일
0

JavaScript

목록 보기
53/87
post-thumbnail

일단 필기!

//기본형(Number, String, Boolean, Null, Undefined)
//변수에 값이 재할당되면, 값이 바뀌는 것

let x = 3;
let y = x;

console.log(x);   //3
console.log(y);   //3
y=5;
console.log(x);   //3
console.log(y);   //5

요약

말그대로 일반적인 형태이며, 복사를 했을때 값만 복사가 되는 형태!

profile
필요하다면 공부하는 개발자, 한승준

0개의 댓글