Jsonify: can help you match up brackets and braces, help you check your code, provide detailed error statements, upload files, download your json, and support file types (for both upload and download) other than .json and .txt
Load file:
JSON:
json is written with objects and arrays. Objects are notated with curly braces. {
"car":"Tesla"
}
In this example, "car" is the key, the name. "Tesla" is the value corasponding to the key "car".
Text is written as a string, between quotation marks.
Numbers can just be written without quotation marks: {
"version":6.2,
1: "The number one",
2: "The number two"
}
However, numbers and letters together need to be surrounded by quotation marks. An item that is surrounded in quotation marks is called a string. {
"car1":"Tesla",
"car2":"Toyota",
"numberOfCars": 2
}
Each pair of a key and a value needs to be seperated by a comma, as notated in the examples.
Arrays are notated with square braces.
[
"item1",
"item2",
"item3"
]
Each item can be a number or string, and has to be seperated by a comma.
[
1,
2,
3
]
Finally, you can have objecs and arrays inside of each other:
{
"firstArray":[1, 2, 3]
"firstObject":{"number":1}
"arrayInsideObject":{"anotherArray":["hi", "hello"]}
"objectInsideArray":[{"car":"Tesla"}, {"plane":"Boeing"}]
"arrayInsideArray":[[1, 2, 3], ["one", "two", "three"]]
"arrayInsideObjectInsideObject":{"anotherObject":{"arabic":[1, 2, 3], "english":["one", "two", "three"]}}
}
Or,
[
[1, 2, 3],
[4, 5, 6],
{"boeing":737},
]
Debugging:
your error might look something like this: SyntaxError: Unexpected token d in JSON at line 2, column 3
It means that you have the token "d" in the second line, the third character of that line. Or, you might get an error without the line and column, which means that you probably forgot a curly brace or square bracket.