Array Overrides

Code in this post can be obsolete, however, principles and theory may still apply.
On the way of development of my project I came to need to have set methods for javascript Array object especially intersection. Googling has shown up some but they were not LGPL, the licence what I need, so I’ve written them.

The following override contains:

  • Ext message box input type configuration
  • Conditional Ext.overrideIf
  • New Array methods:
    • copy – one dimensional copy method
    • indexOf – index of a value within the array. New browsers may already implement this method, therefore conditional override.
    • lastIndexOf – last index of a value within the array. May be already implemented by browser too.
    • intersect – returns intersection of arrays, for example: [1,3,5,7].intersect([2,3,8,7,5]) returns [3,5,7]
    • union – returns union of arrays, for example: [1,3,5,7].union([2,3,8,7,5]) returns [1,2,3,5,7,8]
    • unique – removes duplicate values from the array and returns result as new array
  • Ext.ux.clone – deep object or array cloning function

Overrides code:

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Google+Pin on PinterestEmail this to someone
Follow me:


I'm a well seasoned developer, consultant and educator of web applications based mainly on Sencha libraries, PHP, MySQL and Node.js. Besides (Apple) computers, I love photography and mountain biking.
Follow me:

Latest posts by Saki (see all)


We will be happy to hear back from you

Please Login to post a comment