expand (extention) {
    // extend starts and ends of each rows
    for (let i = 0; i < this.size; i++) {
      this.matrix[i].unshift(...this._createRow(extention))
      this.matrix[i].push(...this._createRow(extention))
    }
    // update size.
    // the estention is applied all size
    this.size += 2 * extention
    for (let i = 0; i < extention; i++) {
      this.matrix.unshift(this._createRow(this.size))
      this.matrix.push(this._createRow(this.size))
    }
  }
/**
   * add extention times row/col in all 4 directions
   * this.size is update adding 2 times extention
   * because extention is applied in every directions
   * @param { int } extention for the matrix
   */
add extention times row/col in all 4 directions
this.size is update adding 2 times extention
because extention is applied in every directions
@param { int } extention for the matrix
add extention times row / col in all 4 directions this . size is update adding 2 times extention because extention is applied in every directions @param { int } extention for the matrix
expand (extention) {
    for (let i = 0; i < this.size; i++) {
      this.matrix[i].unshift(...this._createRow(extention))
      this.matrix[i].push(...this._createRow(extention))
    }
    this.size += 2 * extention
    for (let i = 0; i < extention; i++) {
      this.matrix.unshift(this._createRow(this.size))
      this.matrix.push(this._createRow(this.size))
    }
  }
expand ( extention ) { for ( let i = 0 ; i < this . size ; i ++ ) { this . matrix [ i ] . unshift ( ... this . _createRow ( extention ) ) this . matrix [ i ] . push ( ... this . _createRow ( extention ) ) } this . size += 2 * extention for ( let i = 0 ; i < extention ; i ++ ) { this . matrix . unshift ( this . _createRow ( this . size ) ) this . matrix . push ( this . _createRow ( this . size ) ) } }
add extention times row/col in all 4 directions
 this.size is update adding 2 times extention
 because extention is applied in every directions
 @param { int } extention for the matrix
add extention times row / col in all 4 directions this . size is update adding 2 times extention because extention is applied in every directions @param { int } extention for the matrix
// extend starts and ends of each rows // update size. // the estention is applied all size