자바스크립트에서 객체 프라퍼티가 undefined인지 검사하는 가장 좋은 방법이 뭔가요?
if (typeof something === "undefined") { alert("something is undefined"); }
f (typeof my_obj.someproperties === "undefined"){ console.log('the property is not available...'); // print into console }
이런식으로 응용할수있습니다.
프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.
댓글 입력