Catch if variable is not defined

I am using
“Command”: “comment”,
“Target”: “executeScript_Sandbox // return ["Some Name", "Age", "Gender", "Classic"];”,
“Value”: “fourthMember”,
“Description”: “”

If I comment this command then getting error as “FOURTHMEMBER” is not defined → this is expected ofcourse
Now what I want is how to handle this ??
I want to perform some task if FOURTHMEMBER is not defined

I tried ways as:
${FOURTHMEMBER }!=undefined

but nothing worked

Hi, what you could do here is to define ${FOURTHMEMBER } earlier in the code, and then check for changes:

  • store | -1 | FOURTHMEMBER
  • // executeScript_Sandbox …
  • If ${FOURTHMEMBER } == -1

I changed the logic & now making the data in 2D array