If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

This is not as fast but more useful, it can take 2 arguments, the first is the same as yours (the value to be removed) however the second defines how many of it to remove, if the second is not sent then it will simply remove them all:

Say you have a function f. To time the function with arguments arg0, arg1 & arg2 do

Code:

f.time(arg0,arg1,arg2);

You only need to use eTime-sTime.

There are two ways of measuring the speed of these Array prototypes, the wrong way is to do it a few thousand times on a short array, make sure that you are timing it once on a huge (or as ultimater always says: hugh) array (I dont doubt that you already know this, but just for others).

Thanx for that I made the fix (the first one didnt work because you cannot directly change this), but do note that splice requires a second argument (where to stop cutting). I also made it return count.

pack()

String.prototype.pack is a function that packs the given string to the given amount of characters. If a string is 3 characters long and you pack(10) it then the string becomes 7 spaces longer. If you pack(10) a string of 50 characters, it is cut to only the first 10 characters. So either way your packing the string to 10 characters with pack(10).