Files
ihrm/node_modules/collect.js/docs/api/toJson.md
Nikhil Ravi Cybrosys e1794e7422 [UPDT]translations in the views (#4)
[UPDT]Translations in the views
[FIX]major bug fixes
2023-05-18 15:05:28 +05:30

17 lines
364 B
Markdown
Executable File

# `toJson()`
The toJson method converts the collection into JSON string:
```js
const collection = collect({
id: 384,
name: 'Rayquaza',
gender: 'NA',
});
const json = collection.toJson();
// {"id": 384, "name": "Rayquaza", "gender": "NA"}
```
[View source on GitHub](https://github.com/ecrmnn/collect.js/blob/master/src/methods/toJson.js)