> JSON_FP Hands-On Solutions. - TECH UPDATE

JSON_FP Hands-On Solutions.

 JSON_FP Hands-On Solutions.

The Course Id is 55929.

1. JSON schema validation: Change datatypes and return required JSON data





module.exports= function(){

 

const data = require("./testdata.json");


/*Explore the JSON file and return the required JSON data*/


var json = JSON.parse(data).studentData;

json.forEach(function(element,index){

  element['aggregate'] = parseInt(element['aggregate']);

  per['sub1'] = parseInt(per['sub1']);

  per['sub2'] = parseInt(per['sub2']);

  per['sub3'] = parseInt(per['sub3']);

});

return json;


}



2. JSON Data structuring: Create JSON data with Person Object (data.json)



{

  "persons":{

    "Name":"JSON EXAMPLE",

    "EmployeeID": 1234,

    "Experience": 2,

    "Company":"JSON COMPANY",

    "Designation": "SOFTWARE"

  }

}



3.JSON Data structuring: Create an Array of Favorite Food items objects



[

  {"Name":"JSON NAME1","Type":"JSON TYPE 1","Price":0},

  {"Name":"JSON NAME2","Type":"JSON TYPE 2","Price":0},

  {"Name":"JSON NAME3","Type":"JSON TYPE 3","Price":0}

]




JSON_FP Hands-On Solutions. JSON_FP Hands-On Solutions. Reviewed by TECH UPDATE on May 24, 2022 Rating: 5

No comments:

Powered by Blogger.