📅  最后修改于: 2022-03-11 15:03:35.007000             🧑  作者: Mango
const emptyObject = {}
Object.entries(objectToCheck)
If it returns an empty array, it means the object does not have any enumerable property,
which in turn means it is empty.
Object.entries(objectToCheck).length === 0
Lodash, a popular library, makes it simpler by providing the isEmpty() function:
_.isEmpty(objectToCheck)