Declaring multiple variables in JavaScript

后端 未结 17 916
时光说笑
时光说笑 2020-11-22 13:16

In JavaScript, it is possible to declare multiple variables like this:

var variable1 = "Hello, World!";
var variable2 = "Testing...";
var          


        
17条回答
  •  一整个雨季
    2020-11-22 13:27

    ECMAScript 2015 introduced destructuring assignment which works pretty nice:

    a will equal 1 and b will equal 2.

提交回复
热议问题