1
0
Fork 0
forked from 0x2620/oxjs

merge misc. minor changes

This commit is contained in:
rolux 2012-05-19 12:30:43 +04:00
commit 5cabb679f9
3 changed files with 17 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

View file

@ -356,6 +356,10 @@ Ox.flatten = function(arr) {
return ret;
};
Ox.indexOf = function(arr) {
// indexOf for primitives, test for function, deep equal for others
};
/*@
Ox.merge <f> Merges an array with one or more other arrays
For convenience, literals are treated as arrays with one element
@ -364,6 +368,7 @@ Ox.merge <f> Merges an array with one or more other arrays
> Ox.merge(1, [2, 3, 2], 1)
[1, 2, 3, 2, 1]
@*/
// FIXME: a1.push.apply(a1, a2) should be much faster
Ox.merge = function(arr) {
arr = Ox.toArray(arr);
Ox.forEach(Array.prototype.slice.call(arguments, 1), function(arg) {