slice()1 String을 객체로 사용하는 경우 string은 보통 기본데이터 primitive value ( 객체가 아니면서 메서드도 가지지 않는 데이터) 로 쓰이지만 new를 집어넣어서 객체로서도 사용될 수 있다. let x = "John"; //typeof x = string let y = new String("John"); //typeof y = object 자바스크립트에서 객체는 서로 비교될 수 없다. let x = new String("John"); //object x let y = new String("John"); //object y document.getElementById("demo").innerHTML = (x==y); //false , (x===y)로 해도 false로 나옴..객체는 비교될 수 없음 자바스크립트에서 let name.. 2022. 9. 21. 이전 1 다음