Files
tryno10/app/code/node_modules/collect.js/docs/api/toJson.md
T
2022-04-07 18:09:31 +05:30

348 B

toJson()

The toJson method converts the collection into JSON string:

const collection = collect({
  id: 384,
  name: 'Rayquaza',
  gender: 'NA',
});

const json = collection.toJson();

// {"id": 384, "name": "Rayquaza", "gender": "NA"}

View source on GitHub