Is setting multiple variables in 1 line valid in javascript? (var x=y='value';)

后端 未结 5 1438
春和景丽
春和景丽 2020-12-13 09:17

This is valid in php:

$x=$y=\'value\';

This will in esscence set both $x and $y to \'value\'.

Is this valid in javascript?

5条回答
  •  情话喂你
    2020-12-13 10:00

    I'm pretty sure that the most readable form is the one that has not been brought up yet:

    let x = 0, y = 0
    

提交回复
热议问题