function repeat(str, count) { return count < 0 ? '' : (new Array(count)).join(str); } function diamond(sign, size) { var d, s = '' for (var i = 0; i < size*2; i++) { d = Math.abs(size-i-1); console.log(d+1, 2*(size-d)); s += repeat(' ', d+1) + repea…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Typ…