0

I would get the length of an object on js but I don't know.

Thanks!

  • 1
    Well I don't know either - what you even mean by that to begin with. Please go read [ask] first of all. And then edit your question to contain a proper example object, and what "length" you expect to get back for that. – CBroe Apr 08 '22 at 11:59
  • 1
    Read about Object.keys. You can get the length of that array, if that's what you mean. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys – Rickard Elimää Apr 08 '22 at 12:00

1 Answers1

4

var length = Object.keys(Obj).length;

Ruchi Sharma
  • 112
  • 3