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?

riegersn
  • 2,819
  • 3
  • 17
  • 19
  • 3
    You can do this [with `typeof`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) (although watch out for `null`). – James Donnelly Oct 09 '17 at 13:51
  • `Object.getPrototypeOf(x) == Object.prototype` should do it, however I'm not sure *why* you want to check this. – Bergi Oct 09 '17 at 14:14

0 Answers0