let space = ' ';
let star = '*';
let bar = '|';
let magassag = 10;
let width = magassag * 2 - 1;

for (let i = 1; i < magassag + 1; i++){

	let starnum = i + i - 1;
	let spacenum = (width - starnum) / 2;


	let line = space.repeat(spacenum) + star.repeat(starnum) + space.repeat(spacenum);

	console.log(line);
}

let spnum = (width - 3) / 2;
let barnum = 3;


for (let i = 0; i < 2; i++){
	let line = space.repeat(spnum) + bar.repeat(barnum) + space.repeat(spnum);
	console.log(line);
}
