Is there a way to destructure dates?
I know for objects you can do something like this.
var o = {p: 42, q: true};
var {p, q} = o;
console.log(p); // 42
console.log(q); // true
Is there a better way to do the following in ES6? Does something like object destructuring exist for this?
function getFormattedDate(date) {
return `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`;
}