반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- Array
- 배열
- string
- input
- CSS
- js
- Java
- ArrayList
- CMD
- 자바스크립트
- 인텔리제이
- table
- vscode
- json
- 자바
- html
- Visual Studio Code
- list
- javascript
- 이클립스
- Button
- IntelliJ
- 문자열
- 이탈리아
- Maven
- Eclipse
- 정규식
- windows
- date
- 테이블
Archives
- Today
- Total
목록property (1)
어제 오늘 내일
[Javascript] 객체에 특정 속성이 존재하는지 체크하는 3가지 방법
Javascript의 객체에 특정 속성이 존재하는지 체크하는 방법 3가지를 소개합니다. 1. hasOwnProperty() 함수 const person = { name : 'alice', country: 'korea' } const haveName = person.hasOwnProperty('name'); const haveAge = person.hasOwnProperty('age'); document.writeln(haveName); document.writeln(haveAge); hasOwnProperty 함수는 파라미터로 전달된 property(속성)가 객체에 존재하면 true를 리턴하고, 그렇지 않으면 false를 리턴합니다. 2. in 연산자 사용하기 const person = { name : ..
IT/Javascript
2020. 10. 19. 00:45