index.js
function range(start, stop) {
  if (arguments.length <= 1) {
    stop = start || 0;
    start = 0;
  }

  var length = Math.max(stop - start, 0);
  var idx = 0;
  var arr = new Array(length);

  while(idx < length) {
    arr[idx++] = start;
    start += 1;
  }

  return arr;
}
function range(start, stop) {
  if (arguments.length <= 1) {
    stop = start || 0;
    start = 0;
  }

  var length = Math.max(stop - start, 0);
  var idx = 0;
  var arr = new Array(length);

  while(idx < length) {
    arr[idx++] = start;
    start += 1;
  }

  return arr;
}
function range ( start , stop ) { if ( arguments . length <= 1 ) { stop = start || 0 ; start = 0 ; } var length = Math . max ( stop - start , 0 ) ; var idx = 0 ; var arr = new Array ( length ) ; while ( idx < length ) { arr [ idx ++ ] = start ; start += 1 ; } return arr ; }
Slighlty modified from underscore source
Slighlty modified from underscore source