I'm trying to produce an array that looks like this:
[
{
"values": [
[1, 0],
[2, -6.3382185140371],
[3, -5.9507873460847],
[4, -11.569146943813],
[5, -5.4767332317425],
[6, 0.50794682203014],
[7, -5.5310285460542],
[8, -5.7838296963382],
[9, -7.3249341615649],
[10, -6.7078630712489]
]
}
]
I'm doing an array in javascript that looks like this and only produce the values, but doe not place it within "values" : []:
var myArray = new Array(10);
for (i = 0; i < 10; i++) {
myArray[i] = new Array(2);
myArray[i][0] = i;
myArray[i][1] = 5;
}
var jsonEncoded = JSON.stringify(myArray);
return jsonEncoded;
I'm sure this is an easy answer, but I'm not experience enough to know. Thanks for the help in advance.
-6.33…part of[2, -6.33…])?