简体   繁体   中英

Module parse failed: Unexpected token . You may need an additional loader to handle the result of these loaders

What is this syntax message?.length === 1 can anyone explain me how to convert it into normal javascript?

在此处输入图片说明

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.

message?.length === 1 could be replaced by message && message.length === 1 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM