0

After print an object data.allDueDateObj on console I am getting data like

[Object { vaccineName="MMR",  dueDate="2015-09-30T18:00:00Z"}, Object { vaccineName="Influenza",  dueDate="2015-11-30T18:00:00Z"}, Object { vaccineName="Typhoid",  dueDate="2016-02-29T18:00:00Z"}, Object { vaccineName="Meningococcal ACWY",  dueDate="2016-07-31T18:00:00Z"}]

Now I am counting total how many object in data.allDueDateObj .

1
  • Can you post the actual object, instead of its console representation. From what you have, it looks like the syntax is incorrect. Commented Sep 11, 2015 at 8:08

2 Answers 2

1

Use Array.prototype.length property

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

3 Comments

Just a question is his array a valid one?
@pekka yes! The posted one is the console representation. Although OP has posted key value pairs with =. That is where you doubt right.
I still get confused with a valid and invalid one so i had to ask @Jai thank you for clarification
0

Try this

   data.allDueDateObj.length;

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.