mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Apply even more let/const transforms.
This commit is contained in:
10
compact.js
10
compact.js
@@ -14,13 +14,13 @@
|
||||
* // => [1, 2, 3]
|
||||
*/
|
||||
function compact(array) {
|
||||
var index = -1,
|
||||
length = array == null ? 0 : array.length,
|
||||
resIndex = 0,
|
||||
result = [];
|
||||
let index = -1;
|
||||
const length = array == null ? 0 : array.length;
|
||||
let resIndex = 0;
|
||||
const result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
const value = array[index];
|
||||
if (value) {
|
||||
result[resIndex++] = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user