Skip to content

Instantly share code, notes, and snippets.

@loadster
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loadster/7e6a7d7a918af03dc109 to your computer and use it in GitHub Desktop.
Save loadster/7e6a7d7a918af03dc109 to your computer and use it in GitHub Desktop.
Capture the 3rd user's full name from a JSON response
// {"users": [
// {"id": 1, "fullName": "Hank Hill"},
// {"id": 2, "fullName": "Peggy Hill"},
// {"id": 3, "fullName": "Bobby Hill"}
// ]}
function capture(response) {
var json = JSON.parse(response.bodyAsString);
return json.users[2].fullName;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment