JavaScript reference semantics

I’ve decided to have the program grab the events from array, sort them by their unique ID, and put them into cumulative data structures which will be remembered throughout the course of the program.

Each time the API is queried, the newly returned JSON objects will again be sorted, checked for duplicated in the persistent structures.

Questions:
* when I grab the objects from their original JSON and place them in the persistent structure, how should I do it so as to not have the JSON stick around? JS Objects are passed via reference semantics. I worry that if I grab some but not all the objects from their original JSON, the entire JSON structure will persist, consuming resources. I think perhaps something like “clone” would solve this problem.

About ruoian27

Computer science student, taking Student Originated Software presently
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

One Response to JavaScript reference semantics

  1. ruoian27 says:

    Never mind, Array.remove() will solve this fine.

Leave a Reply

Your email address will not be published. Required fields are marked *