function keys values rereduce var picture comments if rereduce for var

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
function(keys, values, rereduce){
var picture, comments = [];
if(!rereduce){
for(var k in values){
if (!k){
picture = values[k];
} else {
comments.push(values[k]);
}
}
} else {
picture = values[0];
for(var v = 1; v < values.length; v++){
for(var k in values[v]){
comments.push(values[v][k]);
}
}
}
return {picture: picture, comments: comments};
}