0

I have following data. How do i can find count/length of permission array.

Students= 

    [
        {
            Name:'Andy', 
            permission:
            [
                {'8778'},
                {'678'},
                {'89898'}
            ]
        }
    ]

2 Answers 2

2

Should be something like this:

Students[0].permission.length

But when there are more students you should iterate to get the length:

for( var i = 0; i < Students.length; i++ ) {
  Students[i].permission.length;
}
Sign up to request clarification or add additional context in comments.

1 Comment

ooops i missed simple adding [0] index... my mistake it is so simple
0
Students[0].permission.length

Simple huhhh

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.