INNER CODE UNIT · JavaScript

isHealthy

irohandev/WebDev-DevOps-Cohort-3.0 · Week-04 NodeJs, Bun, Http Servers/Offline-Videos/01_Express/Array-Kidney-Game/index.js:48

    const isHealthy = req.body.isHealthy;           //yeh input lene ka trika 
    users[0].kidneys.push({
        healthy: isHealthy                          //yeh input de rhe jo postman pe hm input krenge niche notes mein likha hai kaise krna hai
    })
    res.json({
        msg: "Done!"                                //aur yeh msg return krega 
    })
})


app.put("/", function(req, res) {                   //yeh put kr dega like agar user good and bad kidney dono input kiya hai...jo yeh put sare badkidney ko good kidney kr dega ..sabko set kr dega ki good hai
    for (let i = 0; i<users[0].kidneys.length; i++) {
        users[0].kidneys[i].healthy = true;
    }
    res.json({});
})

// removing all the unhealhty kidneys

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…