# Arrays stored in data storage

**URL:** <https://forum.code.org/t/arrays-stored-in-data-storage/25502>\
**Category:** CS Principles\
**Tags:** csp-unit-5\
**Created:** [March 12, 2019, 5:04pm UTC](https://forum.code.org/t/arrays-stored-in-data-storage/25502 "2019-03-12T17:04:31Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![zsawyer](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/zsawyer/32/4302_2.png) [@zsawyer](https://forum.code.org/u/zsawyer)\
**Post date:** [March 14, 2019, 3:10pm UTC](https://forum.code.org/t/arrays-stored-in-data-storage/25502/3 "2019-03-14T15:10:44Z")

</div>

Thank you, that was a perfect solution.  
The same process can for more complicated objects as well.  
var assn1 = new ASSIGNMENT(“Work”, {“val”:80,“weight”:0.2});  
var assnCopy;  
function ASSIGNMENT (name, grade){  
this.name = name;  
this.grade = grade;  
}

```
createRecord("mytable", {data:JSON.stringify(assn1)}, function() {});
readRecords("mytable", {}, function(records) {
  console.log(records[2].data.name);//undefined
  console.log(records[2].data); //{"name":"Work","grade":{"val":80,"weight":0.2}}
  assnCopy = JSON.parse(records[2].data);
  console.log(assnCopy);//{"name":"Work","grade":{"val":80,"weight":0.2}}
  console.log(assnCopy.grade.val);//80
});
```

---

_[View the full topic](https://forum.code.org/t/arrays-stored-in-data-storage/25502)._
