« JavaScript 1.6 - Array extras | Main | for..in vs. for each »

Sun, Oct 09, 2005

JavaScript 1.6 - Array and String generics

The new JavaScript version in Firefox 1.5 introduces "generic" String and Array functions that can be applied on any object by simply calling the function on the String or Array constructor and passing the desired object as the first parameter. Since I could not find a list of all generic functions, I digged through the source code. Here's the result:

  • Array:
    concat, every, filter, forEach, indexOf, join, lastIndexOf, map, pop, push, reverse, shift, slice, some, sort, splice, unshift
  • String:
    charAt, charCodeAt, concat, indexOf, lastIndexOf, localeCompare, match, quote, replace, search, slice, split, substr, substring, toLocaleLowerCase, toLocaleUpperCase, toLowerCase, toUpperCase
Posted by Thomas Much at 21:27
Categories: Browsers, JavaScript