JSFiddle - React, Tailwind, and code Playground
by John Passmore
JavaScript
function wrapperFind(array, val) {
function indexWhere(array, val, conditionFn) {
}
// usage of indexWhere - call (array, key, value, conditionFn
let index=indexWhere(array, val, item=>item.value===val)
console.log ('index: ' + index)5
if (index>=0) {let found=true}
return found;
}
// usage of wrapper - call wrapperFind
let itemsInbasket =['margerita9', 'squidi10', 'squidi15','octopodi10' ]
let srchVal = 'squidi15'
let success=wrapperFind(itemsInBasket, srchVal)
console.log ('success: ' + success)