Snippets Collections
{
  "name": "portfolio",
  "version": "1.0.0",
  "description": "Serhii Yakymenko Site potrfolio.",
  "main": "gulpfile.js",
  "dependencies": {
    "browser-sync": "^2.26.7"
  },
  "devDependencies": {
    "gulp": "^4.0.2",
    "gulp-sass": "^4.1.0"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/serhii-edit/portfolio.git"
  },
  "author": "Serhii Yakymenko",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/serhii-edit/portfolio/issues"
  },
  "homepage": "https://github.com/serhii-edit/portfolio#readme"
}
var profile = {
  name: 'John',
  age: 25,
  isAdmin: false,
  courses: ['html', 'css', 'js']
};

var person = JSON.stringify(profile);
var contacts = '{ "people" : [' +
'{ "firstName":"Joe" , "lastName":"Smith" },' +
'{ "firstName":"Tom" , "lastName":"Hardy" },' +
'{ "firstName":"Ben" , "lastName":"Stiller" } ]}';

var newObject = JSON.parse(contacts);

import org.json.*;


JSONObject obj = new JSONObject(" .... ");
String pageName = obj.getJSONObject("pageInfo").getString("pageName");

JSONArray arr = obj.getJSONArray("posts");
for (int i = 0; i < arr.length(); i++)
{
    String post_id = arr.getJSONObject(i).getString("post_id");
    ......
}
var eventsVariable = '"{events":[' +
    '{"location": "New York", "date": "May 1", "public": "true"},' +
    '{"location": "London", "date": "Apr 24", "public": "false"},' +
    '{"location": "San Frans", "date": "Nov 30", "public": "false"}]}';
    
bookmark
dashboard

Mon Jun 29 2020 22:56:30 GMT+0000 (UTC)

#json
bookmark
dashboard

Sun Jan 19 2020 18:56:05 GMT+0000 (UTC)

#javascript #json #jsfunctions
bookmark
dashboard

Sun Jan 19 2020 18:48:17 GMT+0000 (UTC)

#javascript #json #jsfunctions
bookmark
dashboard

Thu Dec 26 2019 16:01:30 GMT+0000 (UTC) https://stackoverflow.com/questions/2591098/how-to-parse-json-in-java

#java #howto #json

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension