Skip to content

Instantly share code, notes, and snippets.

@silentmatt
Created June 17, 2009 18:09
Show Gist options
  • Save silentmatt/131398 to your computer and use it in GitHub Desktop.
Save silentmatt/131398 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Jun 17, 2009.
    12 changes: 12 additions & 0 deletions createArray.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    function createArray(length) {
    var a = new Array(Number(length) || 0);

    if (arguments.length > 1) {
    var args = Array.prototype.slice.call(arguments, 1);
    for (var i = 0; i < length; i++) {
    a[i] = createArray.apply(this, args);
    }
    }

    return a;
    }