How to check if an object is empty in JavaScript? (simple and reliable ways)
Hi! I just started learning JavaScript and came across a task: I need to check if an object is empty (i.e., contains no own properties). At first glance it seems simple, but in reality it turned out to be more complicated.\n\nHere's an example: I have an object `userSettings` that can be empty if the user hasn't configured anything:\n\n```javascript\nlet userSettings = {};\n```\n\nI want to write a condition like:\n\n```javascript\nif (userSettings === {}) {\n console.log("No settings");\n}\n```\n\nBut this doesn't work. I understand that the `===` operator compares references, not the contents of objects. Then I tried `Object.keys(userSettings).length === 0`, but I heard this method might have issues. I also saw someone using `JSON.stringify(userSettings) === '{}'`, but