Skip to content
Advertisement

How to get single variables out of 3 dimensional array?

I’ve got something I think it is a 3 dimensional array:

JavaScript

So there are 2 arrays packed inside the variable. First is separated by | the second one by ,

What I need to do is: separate them and then check for an ID located before the name and give me single variables of the rest. I tried it like this:

JavaScript

But all i get then is:

JavaScript

Can anyone help out?

Advertisement

Answer

There is no need loop Into Second Array, You already have defined positions. Always Use break statement to end a Loop immediately, Its a good practice

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement