OpenSource For You

Destructur­ing objects

-

Given below is an object to store details of one Linux distributi­on - Linux Mint. Instead of var, we defined the structure as a const, which is a new keyword in ES6 (covered in an earlier part of this series).

The UTC string contains ‘Mon, 18 Jan 22016 14:24:09 GMT’.T’. After the split, it is an array of strings [Mon, 18, Jan, 2016, 14:25:06, 06, GMT]. The assignment operatio operation in Line 3 extracts only the date, month and year. Note that the first element (index 0) is the week day, which is skipped with a comma in the beginning.

Newspapers in English

Newspapers from India