0

How to access location properties from the following code (JSON Structure) and assign the value in Nodejs.

{ pos : { lon : 30, lat : 30 } }

Thanks

1
  • 1
    This question needs more information. Are you asking about simple access or usage of those properties? Is this data coming from a file, http request/response, etc? Commented Aug 14, 2012 at 18:17

1 Answer 1

2

If you have the JSON in a string variable, you can use

var json = JSON.parse(theString);

And then acces it by

json.pos.lon;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.