Skip to main content

Ivan Teoh

Something personal yet public

164-exercise24b.js

(Source)

1
2
3
4
5
6
7
for (var line = 0, triangle = ""; line < 10; line++) {
    for (var count = 0, hash = ""; count <= line; count++) {
        hash = hash + "#";
    }
    triangle = triangle + hash + '\n';
}
alert(triangle);