-
Notifications
You must be signed in to change notification settings - Fork 0
Noodle stringify() Method
Dan Kranz edited this page Sep 23, 2021
·
2 revisions
Create a JSON string representation of the dataset for data exchange or saving. Rows marked for deletion are removed from the dataset before creation of the output string.
One may customize this method by defining a stringify function in the dataset object.
stringify()
None
var items = [
["1","Vegetable","Tree","1"],
["2","Animal","Bird","1"],
["3","Mineral","Diamond","1"],
["4","Vegetable","Flower","1"],
["5","Vegetable","Grass","1"],
["6","Animal","Cat","1"],
["7","Animal","Dog","1"],
["8","Mineral","Ruby","1"],
["9","Mineral","Quartz","1"]
];
var db1 = new Noodle(items, ["Seq","Category","Item","Count"]);
// Create a JSON string from the dataset
var output = db1.stringify();
[ ["1","Vegetable","Tree","1"], ["2","Animal","Bird","1"], ["3","Mineral","Diamond","1"], ["4","Vegetable","Flower","1"], ["5","Vegetable","Grass","1"], ["6","Animal","Cat","1"], ["7","Animal","Dog","1"], ["8","Mineral","Ruby","1"], ["9","Mineral","Quartz","1"] ]