Andrei Răileanu Andrei Răileanu - 2 months ago 4x
Javascript Question

Manipulate JSON data into another object

I am trying to figure out how to manipulate my JSON data and create a separated object with the manipulated data.

To be more precise, I am using this JSON file:

I am trying to convert [dataset][data] into this format:


So I need to use the fields
(Date) and
(Value) and somehow put it in a new JSON formatted object but I have no idea how to do it.

Someone can help me with this situation?

$(function () {
$.getJSON('json/AAPL.json', function (data) {
// Data manipulation into a new object??


This should do it:

$(function () {
    $.getJSON('json/AAPL.json', function (data) {
        var correctFormat = {
            return [new Date(item[0]), item[4]];