I feel like I'm going crazy... This is a method I swear I've used in the past to check for the existence of a variable or a layer, but it's breaking. What am I doing wrong?
I was expecting the code simply NOT to print the second string. I wasn't expecting a ReferenceError.
I think you just need to add a question mark after the layer names.
For reference it's called an existential operator. Very useful.
Wow... I don't think I've ever used that. I have no idea why I tripped over this today. Either way, thanks for clarifying Struan!