 
	
  자바스크립트에서 사용하는 데이터의 유형에 대해 알아본다.
• 문자데이터형(string)
  • 숫자데이터형(number)
  • 부울형데이터(boolean) - true/false
  • 찾을 수 없는 데이터형(undefined)
  • 값이 없는 데이터(null)
  • 배열형 데이터(function)
  • 객체(object) : document, window, alert, confirm, prompt등...
  
• :typeof 연산자는 사용자가 입력한 데이터가 어떤 종류의 형식인지를 알려주는 연산자이며,
변수앞에 number, string 등을 작성하면 실제 데이터 형식을 알 수 있음
• es6 문법에서 새롭게 추가된 기호
• 연산자를 사용하지 않아도 간단한 방법으로 새로운 문자열을 삽입할 수 있는 기능을 말함
이를 문자열 이플레이션(string interpolation)이라 함
    //1. 원시형 데이터(기본형)
    let a = 10; //숫자데이터
    let b = '10'; //문자데이터
    let c =true; //부울형 데이터(boolean)
    let nl = null; //값이 정의되지 않음(undefined), 변수는 필요하지만 값이 아직 결정되지 않았을 때
    let u;
    document.write(a); //10
    document.write(b); //10
    document.write('변수 a의 데이터 형식은' + typeof(a)); //변수 a의 데이터 형식은number
    document.write('변수 b의 데이터 형식은' + typeof(b)); //변수 b의 데이터 형식은string
    document.write(c); //true
    document.write(nl); //null
    document.write('변수 c의 데이터 형식은' + typeof(c) + '입니다.'); //변수 c의 데이터 형식은boolean
    document.write('변수 nl의 데이터 형식은' + typeof(nl) + '입니다.'); //변수 n의 데이터 형식은object
    document.write(u); //undefined
    document.write('변수 u의 데이터 형식은' + typeof(u) + '입니다.'); //변수 u의 데이터 형식은 undefined
    //2. 참조형데이터 : 여러개의 데이터를 한번에 담을 수 있음
    let array1 = ['일','월','화','수','목','금','토'];
    document.write(array1); //배열 데이터 출력
    document.write(array1[1]); 배열 데이터에 인덱스번호를 입력해 특정 데이터 출력
    let info=['m1yeon','김미연','서울','00-111-2222','30','여'];
    document.write('저는 '+info[2]+'에 살고있는 '+info[4]+'살 '+info[1]+'입니다');//저는 서울에 살고있는 30살 김미연입니다
    //3. 함수(function)형 데이터_바로 출력되지 않고, 만들어두고 실행시켜야 출력됨
    function sam(){
      document.write('함수형 데이터입니다.');
    }
    //함수명으로 호출하기
    sam();
    //4. 객체(object)
    let person = { //사용자 정의 객체
      age:21,
      name:'강감찬',
      job:'웹퍼블리셔',
      height:'175'
    };
    //객체 내용 출력하기
    document.write(person.age); //21
    document.write(person.name); //강감찬
    document.write(person.job); //웹퍼블리셔
    document.write(person.height); //175
    //제 이름은 강감찬이고, 21살이고, 키는 175, 집업은 웹퍼블리셔입니다. 출력하기
    document.write(`나의 이름은 ${person.name}이고, 나이는 ${person.age}이며, 키는 ${person.height}, 직업은 ${person.job}입니다`);