Cisco Interview Question

write a javascript prototype for a class to alculate total number of items in a function which has nested arrays.

Interview Answers

Anonymous

Mar 18, 2015

Recursive function ok but the last part is confusing "a function that has nested arrays" what is that function? how do we access it? does it return nested arrays?if so how many? I would have asked a lot of questions before that. if it was like a nested arrays in param of the prototype you are writing then a recursive function will be suitable with aparam the nested array and the length of the parent array.

Anonymous

Feb 26, 2015

Used recursive function to do it

1