JS - basic data types

suyeon·2022년 9월 26일
0

Vanilla.js

목록 보기
1/13


basic datatypes

✦ number

  • integer (정수) - 1, 4, 11
  • float (부동소수점) - 0.1, 4976.23
const a = 5;
console.log(a + 3);

>> 8

✦ string

  • text - "hello", "nowhere"
let myName = "sonya";
console.log("my name is " + myName);

>> my name is sonya

✦ boolean

  • true / false

✦ null

  • nothing, 아무것도 없는 상태
const nothing = null;
console.log(nothing);

>> null

✦ undefined

  • 변수가 존재하지만 값이 주어지지 않았을 때.
let something;
console.log(something);

>> undefined
profile
coding & others

0개의 댓글