Hacker News new | past | comments | ask | show | jobs | submit login

5 solution with eval

  function foo(s) {
    a = Array(s);
    for (var i = 0; i < s; i++) {
      a[i] = eval('(function () { return ' + i + '})');
    }
    return a;
  }



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: