Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Add Array#insert

#3

function insert(index) {
  var args = slice.call(arguments, 1);
  this.length = Math.max(this.length, index);
  index = index < 0 ? this.length : index;

  if (args.length > 1) splice.apply(this, [index, 0].concat(args));
  else splice.call(index, 0, args[0]);

  return this;
}

Reported by Joe Gornick · February 4th, 2009 @ 01:05 AM

State: duplicate
Milestone: none
Assigned to: Joe Gornick Joe Gornick

Activity

  1. Joe Gornick
    Joe Gornick
    • State changed from new to duplicate

    This has been added to #15 Array Updates

    February 7th, 2009 @ 02:55 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.