I just want to know how can I check if a key inside a JSON exist or not
In my json file I have:
"repositories": {
"toto": {
"tata": "https://***",
//"titi": "***"
// here titi not exist
}
},
In my script I'm doing:
else if (type === "toto") {
const totoURi = repositories.toto.tata;
const titi = repositories.tgz.titi; // here titi exist so no problem
// but in another case how can I check variable when he not exist
const url =
totoURi +
titi +
"." +
type;
}