Skip to main content

Ivan Teoh

Something personal yet public

164-exercise23.js

(Source)

var triangle = "";
var line = 0;
while (line < 10) {
    var count = 0;
        line = line + 1;
        hash = "";
        while (count < line) {
            hash = hash + "#";
            count = count + 1;
        }
        triangle = triangle + hash + '\n';
}
alert(triangle);