Closed Bug 1342055 Opened 7 years ago Closed 4 years ago

mising example prototype

Categories

(Developer Documentation Graveyard :: General, defect, P5)

All
Other
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: peter.mlich, Unassigned)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

arr[m] = [8,2,5,7,9,6,4,1,3,0];
i = 4;
j = 7;

// number
tmp = arr[m][j];
arr[m].spliceArray(j, 1);
arr[m].spliceArray(i, 0, tmp);

// number - can write as
tmp = arr[m][j];
Array.prototype.splice.apply(arr[m], [j,1]);
Array.prototype.splice.apply(arr[m], [i,0].concat(tmp));

// array
tmp = [ 12, 13 ];
Array.prototype.splice.apply(arr[m], [j,1]);
Array.prototype.splice.apply(arr[m], [i,0].concat(tmp));

(I something trying, and trying, which code is faster nad not see prototype code on page. But without "prototype" is code little faster :) )
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.