I’m shifting elements out of an array. When the array becomes empty, shift returns undefined. The narrat array features don’t have a length/count function. And the documentation doesn’t say how to check for a value being undefined. I experimented with the run_js function, since Javascript can easily test “=== undefined” but I probably wasn’t integrating it into the narrat code correctly. Specifically, I was trying to put the Javascript test for undefined into a narrat “if” statement.
For example:
… code …
… there is a valid array being created …
… code ran successfully on elements that got shifted out of the array and now it’s empty …
var target (shift $array)
… I want to have code operate on $target but I need to know that its value is now undefined …
Thanks for any help!!!