-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlodas.js
42 lines (33 loc) · 918 Bytes
/
lodas.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(function(window){
var lodash = {};
function chunk(array,size){
var temp = [];
var other = [];
var counter = 0;
for(i=0; i < array.length;i++){
if(other.length < size){
other.push(array[i]);
count++
}else{
temp.push(other);
other.length = 0;
other.push(array[i]);
}
}
return temp;
};
function compact(array){
var some =[];
for(i=0;i<array.length;i++){
debugger
if(array[i] !== false && array[i] !== "" && array[i] !== null && array[i] !== undefined && array[i] !== 0 && array[i] !== NaN)
{
some.push(array[i]);
}
}
return some;
};
lodash.chunk = chunk;
lodash.compact = compact;
window.lodash = lodash;
})(window);