cannalee90 / flash-card

Flashcard web application
4 stars 0 forks source link

blank object를 판단하기 위한 좋은 방법 #23

Closed cannalee90 closed 6 years ago

cannalee90 commented 6 years ago

현재는 Object.keys(obj).length를 사용중

cannalee90 commented 6 years ago

https://stackoverflow.com/questions/4994201/is-object-empty

cannalee90 commented 6 years ago

http://www.ericfeminella.com/blog/2012/08/18/determining-if-an-object-is-empty-with-underscore-lo-dash/

cannalee90 commented 6 years ago

https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames

cannalee90 commented 6 years ago

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys

cannalee90 commented 6 years ago

Object.keys는 enumberable한 key값을 반환하지 않으므로 getOwnProperty를 사용하자