I was hoping I could just assign true / false to a variable if my element exists in an associative array.
I tried this —
var finalDisExist = stepsArray['stepIDFinal'];
— of course this does exactly what you would think it does (assigning the object to the variable.
But I am pretty sure I have seen something close to this before, can someone tell me what I am missing?
Thanks!
Todd
Perhaps, the quickest and best way is
stepsArray.hasOwnProperty('stepIDFinal').NB: Do NOT use
'stepIDFinal' in stepsArray, since this will check the entire prototype chain for your “hashmap” object and detecttoStringamong others…