Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialyadin michaeli
Courses Plus Student 5,423 PointsDidn't get this JSONObject
Hello.
I Didn't actually get this JSONObject method that we write can somebody explain it to me please?
1 Answer
Ben Deitch
Treehouse TeacherSure. So we've got our JSON data as a String, which is great, but it's kind of hard to access any individual piece of data in that String. JSONObject takes in the JSON String and gives us an object that makes it a lot easier to access each piece of data.
yadin michaeli
Courses Plus Student 5,423 Pointsyadin michaeli
Courses Plus Student 5,423 PointsHey Ben thanks for answering! i have 2 more question please...1 the JSON data String is that response.body.string? and 2 i dindnt get what is that string name? like we wrote "timezone"?
Ben Deitch
Treehouse TeacherBen Deitch
Treehouse Teacheryadin michaeli
Courses Plus Student 5,423 Pointsyadin michaeli
Courses Plus Student 5,423 PointsOhhhh thank you very very much! :)