<script> var lines = line = 8, a='.', b='*'; while(line-->0) document.write(Array(line+1).join(a) +Array(2*(lines-line)).join(b) +Array(line+1).join(a)+"<br>"); </script>