add function to check string existance in array elements

fix-non-showing-inputs
Moe Alam 2020-11-01 17:45:25 -08:00
parent 80b364ddec
commit fb841001af
1 changed files with 8 additions and 0 deletions

View File

@ -31,4 +31,12 @@ const mergeDeep = function(...objects) {
return prev;
}, {});
}
const arrayContains = (query,theArray) => {
var foundQuery = false
theArray.forEach((value) => {
if(value.indexOf(query) > -1)foundQuery = true
})
return foundQuery
}
exports.mergeDeep = mergeDeep
exports.arrayContains = arrayContains