(array)
| 207 | }); |
| 208 | |
| 209 | function compact(array) { |
| 210 | let resIndex = 0; |
| 211 | const result = []; |
| 212 | if (array == null) { |
| 213 | return result; |
| 214 | } |
| 215 | for (const value of array) { |
| 216 | if (value) { |
| 217 | result[resIndex++] = value; |
| 218 | } |
| 219 | } |
| 220 | return result; |
| 221 | } |
| 222 | |
| 223 | const result = {}; |
| 224 | array.forEach((a) => { |