You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If some value from arr1 exists in arr2 i wanna return true
/** JS Implementation */
function check() {
return arr1.some(item => {
if (arr2.some(c => c == item)) {
console.log(item)
return true
}
return false
})
}
I tried to do this with var operator and some but seems that scope of some has only local variables and doesn't have variables from closure.
Is there a way to achieve it with default json-logic operators? (i mean without adding new operators via json-logic.add_operator())
Thanks in advance ^_^
The text was updated successfully, but these errors were encountered:
Hi @jakemedal , as far as i understood there is no standard operators for this. Out team implemented custom logic, but via C# on backend (since we use json-logic at frontend and backend)
Suppose I have two arrays:
var arr1 = [ 52, 66, 88, 43, 98 ]
var arr2 = [ 41, 42, 43, 45, 46, 49, 52, 53, 79 ]
If some value from
arr1
exists inarr2
i wanna return trueI tried to do this with
var
operator andsome
but seems that scope ofsome
has only local variables and doesn't have variables from closure.Is there a way to achieve it with default json-logic operators? (i mean without adding new operators via
json-logic.add_operator()
)Thanks in advance ^_^
The text was updated successfully, but these errors were encountered: