I\'d like a certain function to create a grid and insert a unique object in each slot. The key here is, the function should accept the constructor as a parameter (as there can b
Pass the buildNewObject as a function, instead of calling it and passing its result.
buildNewObject
function newGrid(rows,cols,dataFunction) { var customGrid = []; for (var row=0;row
var myGrid = newGrid(3,3,buildNewObj); // no parenthesis, no invocation