What is this syntax message?.length === 1 can anyone explain me how to convert it into normal javascript?
message?.length === 1
It is a vue js component I downloaded from somewhere but when I put into my project it gets an error
a?.b is the "optional chaining" operator, which returns undefined when one of the chained properties is undefined or null.
a?.b
message?.length === 1 could be replaced by message && message.length === 1.
message && message.length === 1