json javascript view code example
Example 1: create a json object in javascript
var employee = {
"firstName": firstName,
"lastName": lastName
}
Example 2: pretty print json in console
new JSONObject(json).toString(2)
var employee = {
"firstName": firstName,
"lastName": lastName
}
new JSONObject(json).toString(2)