i have a separate JSON array file which i have my data, but according to user inputs i need to change three values in my JSON then do my http request. i'm stuck at assigning the values i get from my users to the pre define JSON array file i have.
example.json
{
"packageName": "example",
"packageType": "example",
"navigationType": "example",
"description":"",
"consoleAccessLimit": [
{
"accessType": "example4",
"accessLimit": 2
},
{
"accessType": "example3",
"accessLimit": 1
},
{
"accessType": "example2",
"accessLimit": 1
}
]}
i need to change accesslimit of example4, accesslimit of example 3 and accesslimit of example 1
my code following
function askme() {
askDetails("Enter example1 Count:", /.+/, function(scount) {
askDetails("Enter example 3 Count:", /.+/, function (acount) {
askDetails("Enter example 2 Count:", /.+/,function (wcount) {
askDetails("Enter example 4 count:",/.+/,function (price) {
var youexample = (require('./example/example.json'));
// how do i assign the values to my example.json
})
})
})
});
}
please help folks thank you