last-index.js 422 B

1234567891011121314151617
  1. "use strict";
  2. module.exports = function (t, a) {
  3. var x;
  4. a(t.call([]), null, "Empty");
  5. a(t.call([null]), 0, "One value");
  6. a(t.call([1, 2, 3]), 2, "Many values");
  7. a(t.call(new Array(1000)), null, "Sparse empty");
  8. x = [];
  9. x[883] = null;
  10. x[890] = undefined;
  11. a(t.call(x), 890, "Manual sparse, distant value");
  12. x = new Array(1000);
  13. x[657] = null;
  14. x[700] = undefined;
  15. a(t.call(x), 700, "Sparse, distant value");
  16. };