Skip to content
Advertisement

Multiple arrays inside a array in javascript

when i do console.log(myArray) I obtain this:

console.log result

I want to take a value inside only one of this arrays, but how? When i do console.log(array[0]) I obtain this result:

37.7
28.45
36.38

Advertisement

Answer

From what I can see in the original question so far, the output of this function is actually three different console.log() executions, which leads me to believe that whatever is firing these console.logs is actually running in some sort of loop.

If that is the case, you will not be able to pull just one value out to simply. The screenshot you added only shows the output. Could you please add the code for (or screenshot of) all the related code from setting up or fetching the array, to your console.log? With all that context, I can rewrite my answer to get you the exact answer you are looking for.

Advertisement