I've been struggling with this error for the past couple of hours. Currently, I'm in the process of developing an idle game centered around building your own city. The issue arises when I attempt to delete a building from the build queue array. Every time I try methods like .shift
, .pop
, .push
, .indexOf(0) === 0
, [0] === ""
and even .splice(1,1)
, I keep getting errors stating that these functions are not recognized.
Unfortunately, none of my attempts have proven successful. Can anyone please provide assistance?
if (buildValue === 100 && buildQueue.indexOf("house") === 0){
populationmax++;
// Here, I need a command that will remove the first element from the buildQueue array.
buildValue = 0;
}