Make minesweeper: how to make numbers to detect the bomb

below is my source code. can anyone help me ?to finishto solve this problem
this.arr = [];
this.arr1 = [];
var arr2=[];
var arr3=[];
var arr4=[];
var y = 0;
for (var i = 0; i <= 10; i++) {
for (var j = 0; j <=10; j++) {
var posisiX=272+j*32;
var posisiY=172+y;
var alas= this.add.sprite(posisiX, posisiY, “alas”).setDepth(10);
this.arr.push(alas);

}

y += 32;

}
for(var jb=0;jb<=9;jb++){
var a = Math.floor(Phaser.Math.Between(1, 9) * 32) + 272;
var b = Math.floor(Phaser.Math.Between(1, 9) * 32) + 172;
var bom= this.add.sprite(a, b, “bomGame”).setDepth(12);
arr2.push(bom);
arr3.push(a);
arr4.push(b);
if(arr2[jb]!=null){
for(var j=-1;j<=1;j++){
for(var i=-1;i<=1;i++){
var aa= a+i32;
var bb= b+j
32;
if(i!=0||j!=0){
var angka1 = this.add.sprite(aa, bb, “1”).setDepth(11);
for(var c=0;c<=9;c++){
if(arr3[jb]+i32==arr3[c] && arr4[jb]+i32==arr4[c]){
var angka2 = this.add.sprite(arr3[jb]+i32,arr4[jb]+j32,“2”).setDepth(11);
}

}
}
}
}
}
}

This is a nice tutorial.