怎麼檢查 object 是不是空的?


Posted by Rich on 2021-09-12

有時候會有這種需求,這次解決的幫手是:

let obj = {}
if (Object.keys(obj).length === 0) //true

怕忘記,紀錄一下。










Related Posts

46 年老技術與 Web 的新火花 - Actor Model in Web

46 年老技術與 Web 的新火花 - Actor Model in Web

js 實作 2FA 驗證

js 實作 2FA 驗證

Lecture 1 Introduction to Radar Systems and Applications

Lecture 1 Introduction to Radar Systems and Applications


Comments