code: function initArray(layer) {
         // initialize the array
         layer.layerData = new Array(layer.cols);
  
         for (var x = 0; x < layer.cols; x++) {
           layer.layerData[x] = new Array(layer.rows);
  
           for (var y = 0; y < layer.rows; y++) {
             layer.layerData[x][y] = null;
           }
         }
       }
docs: Create required arrays for the given layer object
  @ignore