Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

JSON review

So I decided because I need to get in better shape I was going to start tracking my fitness. I used to use some prebuilt means by way of bodybuilding.com but thought I might build my own UI and track my own data. with tables and graphs and other nerdy stuff that I enjoy.

I currently have some dummy data in the way of a JSON file (I wish I could say the data was totally fake and not actually accurate)... I currently only have one object for each date although I am hoping to have multiple dates in there to track historical changes.

Anyone care to look over my JSON if should be technically correct but I'm looking for a peer review to make sure I won't run into issues later with the JSON coming back i na way not conducive for what I want.

[{    
    "measurements" : {
        "weight" : [{
            "07-07-2016" : {
                "pounds" : 188.7
            }
        }],
        "thighs" : [{
            "07-07-2016" : {
                "inches" : 20.5 
            }
        }],
        "body-fat" : [{
            "07-07-2016" : {
                "percent" : 18.0 
            }
        }],
        "forearms" : [{
            "07-07-2016" : {
                "inches" : 11.5
            }
        }],
        "chest" : [{
            "07-07-2016" : {
                "inches" : 40.0 
            }
        }],
        "calves" : [{
            "07-07-2016" : {
                "inches" : 14.5 
            }
        }],
        "arms" : [{
            "07-07-2016" : {
                "inches" : 13.5 
            }
        }],
        "shoulders" : [{
            "07-07-2016" : {
                "inches" : 47.0 
            }
        }],
        "hips" : [{
            "07-07-2016" : {
                "inches" : 40.5 
            }
        }],
        "neck" : [{
            "07-07-2016" : {
                "inches" : 16.5 
            }
        }],
        "waist" : [{
            "07-07-2016" : {
                "inches" : 32.8 
            }
        }],
        "height" : [{
            "07-07-2016" : {
                "feet" : 5,
                "inches" : 11.5
            }
        }]
    }, 
    "strength" : {
        "bench" : [{
            "07-07-2016" : {
                "pounds" : 225 
            }
        }],
        "bicep-curl" : [{
            "07-07-2016" : {
                "pounds" : 85 
            }
        }],
        "squat" : [{
            "07-07-2016" : {
                "pounds" : 195 
            }
        }],
        "barbell-rows" : [{
            "07-07-2016" : {
                "pounds" : 155 
            }
        }],
        "deadlift" : [{
            "07-07-2016" : {
                "pounds" : 165 
            }
        }],
        "overhead-press" : [{
            "07-07-2016" : {
                "pounds" : 115 
            }
        }]
    }
}]

1 Answer

I have, syntactfully I can figure it out, but I'm wondering objectively what hurdles I'm going to run into. eg measurement objects, which child objects of types, with children of dates, versus objects of dates with children of measurements, with children on type.