for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
/**
* Highly efficient filter on a value in an object
* @param {Array} arr the array of objects
* @param {string} key the key to filter on
* @param {mixed} value the value to compare
* @return {Array} the filtered array
*/
export function filter(arr, key, value) {
var result = [];
var i = 0;
var len = arr.length;
for (; i < len; i += 1) {
var elt = arr[i];
if (elt[key] == value) {
result.push(element);
element
/** global: element */
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.
}
return result;
* Highly efficient find indexes on a value in an property of an object
* @return {Array} the filtered array of indexes
export function find(arr, key, value) {
result.push(i);
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.