Pulling out object {0: }

I need to pull out some stuff from a javascript object. It looks like such:

{
  "0": {},
  "length": 1,
  "prevObject": {
    "0": {},
    "context": {},
    "length": 1
  },
  "context": {},
  "selector": ".rsCaption"
}

trying to set theCaption = caption.0 gives me an error of “Uncaught SyntaxError: unexpected token: numeric literal”

How do I pull out that object in the “0” position?

As the property name starts with a number, you need to use bracket notation:
caption[“0”]

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.