简体   繁体   中英

What does variable declaration with multiple comma separated values mean (e.g. var a = b,c,d;)

When I try to understand plugin codes, I often find these kind of declarations but I don't know exactly what it means.

var a = b,c,d;

This is a syntactic shorthand, and identical to:

var a = b;
var c;
var d;

The first one (a) gets initialized with the value of b, but c and d are uninitialized.

它将定义var a = b ,然后定义var c和d

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