I want to fetch an ID from json file and substitute it in a javascript function . I’m quite stuck. how do I proceed?

// demo.json

{
“id”:”35179″,
“key”:”17676″,
“fields”:{
“description”:”A small, distinct piece of work.”,
“name”:”Task”,
“hierarchyLevel”:0
},

//I need to fetch the id field and replace it in “mainID” in the below function

(function() {

var mainID
    atlToken = getAtlToken();
function createTask(tasks, step) {
    step = step || 0;
    console.log(tasks, tasks[0]);
    triggerCreateTask(tasks[step++], () => {
        step < tasks.length && createTask(tasks, step);
    });
}