0

I'm looking to check if an object is just a simple {} with key:value pairs and not a function, array, string number and so on. Is this possible?

2
  • 3
    You can do this with typeof (although watch out for null). Commented Oct 9, 2017 at 13:51
  • Object.getPrototypeOf(x) == Object.prototype should do it, however I'm not sure why you want to check this. Commented Oct 9, 2017 at 14:14

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.