The Student Room Group

terraforming functions iDEA

How do I write a loop statement to go through the terraforming functions.

Code:
var terraformingFunctions = [water,gasses,light,atmosphere,temperature]
var terraformingFunctions = [water, gasses, light, atmosphere, temperature];
for (var i = 0; i < terraformingFunctions.length; i++) {
terraformingFunctions(); // Call each function
}

Quick Reply

Latest