#Is it possible to have `undefined` in an array?

1 messages · Page 1 of 1 (latest)

ashen forum
#
const a = ["A", "B", undefined]
for (const element of a) {
    print(element);
}
zinc ravine
#

Why would you work with undefined? Just remove the object

brazen harness
#

couldn't you just use a substitute if you specifically want something to unavailable?
just set it to a blank string and check if it's set to that
I can't imagine a reason you would specifically need it to be undefined and not just... not defined the same way as everything else

ashen forum
zinc ravine
#

Again, why?

#

What is the usecase of using undefined