Skip to content

XML Code Notes (data structure) : How to use ? #2493

Answered by zadam
PhilB-RLB asked this question in Q&A
Discussion options

You must be logged in to vote

If you can choose then I recommend JSON since it's easier to work with in JavaScript.

Not sure how much you already know, but once you have a note object, then getting the underlying JSON data content is simple like this:

const data = note.getJsonContent();

for (const artist of data) {
     console.log(artist.firstName, artist.lastName);
}

Structure can be whatever you want, e.g. array of objects as used in the code sample.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@PhilB-RLB
Comment options

@zadam
Comment options

@PhilB-RLB
Comment options

Answer selected by PhilB-RLB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants