- Take an
Array
orObject
of your choice and copy it to your clipboard. - Search:
convert javascript to json
- Tool: Convert JS to JSON
- Paste your Javascript into a converter (above) of your choice.
- Copy the JSON result to your clipboard.
- Paste the JSON into a file with a
.json
extension.
Important: json
files are for data only. Don't include Javascript logic like =
, const
, etc. Stick to arrays and object values.