1

I have this object:

enter image description here

And I want to get the index of "AUG" or "JUL", for exemple...

I tried:

graph1.indexOf( "AUG" );

But it returns this error: TypeError: undefined is not a function

0

1 Answer 1

6

Javascript objects are unordered. In a way, AUG is the index. (Unlike arrays, which are indexed numerically).

There's probably another way to achieve what you're after – you might like to start a new question explaining what it is you're trying to achieve. (I suspect it might be an array of objects – looking something like this – but of course this is a guess based on the limited information on offer):

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.