Skip to main content

Ivan Teoh

Something personal yet public

167-exercise42.js

(Source)

1
2
3
4
5
6
7
8
function range(num) {
    var list = [];
    for (var i = 0; i <= num; i++) {
        list[i] = i;
    }
    return list;
}
document.write(range(5));