xs.js | Never Too Many Collections
xs is a JavaScript library that lets you treat most everything like a collection that just does what you mean with via a unified, consistent interface.
// Objects...var o = ;o;// --> [ 'a', 'b', 'c', '3' ]o;// --> [ 1, 2, 3, 'd' ]o;// --> 'd' // Arrays...var a = ;a;// --> [ 0, 1, 2, 3 ]a;// --> [ 1, 2, 3, 'd' ]a;// --> 'd' var { return x+1; };o;// --> xs({ a:2, b:3, c:4, 3:'d1' })a;// --> xs([ 2, 3, 4, 'd1' ])
- Supports both Object-oriented and Functional styles.
- Plays nice with other libraries (like jQuery).
- Extensible via simple plugins.