I tried running your code in a hello-express project, and although the logs showed no errors, the code linting gave me an error saying Parsing error: deleting local variable in strict mode. But I do not have strict mode enabled…
Dont do that. Save the index in avariable and then remove the element using filter or splice. Do not use a delete on arrays because the array will not be reindexed you merely delete the element leaving an undefined ati ts place. Alao dont delete local variables as its useless
As @JaielSoft mentioned, you should try using splice:
let roblox = require("./roblox.json");
let index = Math.floor(Math.random() * roblox.code.length);
roblox.code.splice(index,index+1);
console.log(roblox.code);