/*공심直角삼각형*/
for (var i = 0; i < 10; i++) {
(i == 0 || i == 9) ? document.write(Array(i + 2).join("* ") + "
") : document.write("*" + Array(i + 1).join(" ") + "*
");
}
/*공심菱형*/
var arr = [];
for (var p = 0; p
(p == 0) ? arr.push(Array(6).join(" ") + "*
") : arr.push(Array(6 - p).join(" ") + "*" + Array(p * 2 + 1).join(" ") + "*
");
}
(document.write(arr.join("")), arr.pop(), document.write(arr.reverse().join("")));