0
Hello
I have a variable in Nodejs that sometimes comes with the following content:
{ '$instance': {} }
and sometimes it comes like this:
{
'$instance': { numeropessoas: [ [Object] ] },
numeropessoas: [ '2' ]
}
How can I know (make an IF) which check came with the "numeropessoas"? I need to know because I want to try to take the value of it this way: "step. _info.options.numero pessoas[0];" and when it does not exist, it is causing me an error.
You can check by doing
if ('numeropessoas' in step._info.options)
– Andre