Many of the array functionality present in libraries like lodash.com or underscorejs.org are available on the Array prototype.
The following patterns are considered warnings:
import _ from 'lodash';
function getEvenNumbers(numbers) {
return _.filter(numbers, num => num % 2 === 0);
}
import _ from 'lodash';
function increment(numbers) {
return _.map(numbers, num => num + 1);
}
The following patterns are not considered warnings:
function getEvenNumbers(numbers) {
return numbers.filter(num => num % 2 === 0);
}
function increment(numbers) {
return numbers.map(num => num + 1);
}