Using Javascript's ES6 or node, you can do the following:
<!DOCTYPE html>
<html>
<body>
<div id="test"></div>
<script>
var [a,b,c,d] = [0,1,2,3];
document.getElementById("test").innerHTML = a + b + c + d;
</script>
<div id="test1"></div>
<script>
const person = { name: 'John Doe', age: 23, id: 1 };
let {name, age, id} = person;
document.getElementById("test1").innerHTML = name + age + id;
</script>
<div id="test2"></div>
<script>
let [x, y, z] = Array(3).fill(0);
document.getElementById("test2").innerHTML = x + y + z;
</script>
</body>
</html>
Most Helpful This Week
JavaScript example to change image on click
Generate random password for form field on click using JavaScript
jQuery Show or Hide text on button click
What's the difference between let and var?
How can I redirect the user from one page to another using jQuery or pure JavaScript?
Using jQuery add new table row on click
jQuery simple form validations between start date and end date
How to declare multiple variables in one statement in Javascript?
How to change text after click event using JavaScript?
How to set checkbox and radio option checked on load with jQuery?