I do not know how to call this to search Google or if it is possible to do so. I have an object that looks like this:
var clear = {
Search_r: false,
Search_f: false,
Search_e: false
}
And I have the following function
function clearSearch(clear) {
if(clear.Search_r) {
$(".search-r").html("")
}
if(clear.Search_f) {
$(".search-f").html("")
}
if(clear.Search_e) {
$(".search-e").html("")
}
}
I call the function like this
clear.Search_r = true
clearSearch(clear)
It works fine, but I wanted to know how to pass true
inside the function call and not the top line. Something like:
clearSearch(clear.Search_r = true) //isso não funciona e nem da erro
That is, it does not work, undefined . How would that be correct and if possible, how would you write this in Google to find other solutions?