Code below (js):
JSON = {"name":"John","stats":["canFly","invincible","noClip","canBuild"]};
function disableGodStats(JSON){
for (i = 0; i < JSON.stats.length; i++) {
if (JSON.stats[i] == "canFly" || JSON.stats[i] == "invincible" || JSON.stats[i] == "noClip" || JSON.stats[i] == "allowCommands") {
JSON.stats.splice(i, 1);
i--;
}
}
return JSON;
}
disableGodStats(JSON);
The code snippet above I used for a small player database for a little online game.
when ran in Script Editor (for testing) it produces an output without quotation marks, which is weird, because the JSON code now does not validate for strict JSON which requires those.
Edit: Example output - notice missing quotes:
{name:John, stats:[canBuild]}