Does JavaScript treat:
array.filter(x => {
const test = [1, 2, 3]
return test.includes(x);
});
the same as:
const test = [1, 2, 3]
array.filter(x => {
return test.includes(x);
});
or will the const cause extra work on each evaluation in the former?