forked from 0x2620/oxjs
merge misc. minor changes
This commit is contained in:
parent
6acfd505e6
commit
5cabb679f9
3 changed files with 17 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue