loading...

re: Make Your Code Cleaner, Shorter and Easier to Read! ES6 Tips and Tricks. VIEW POST

FULL DISCUSSION
 

In console I have: "Uncaught SyntaxError: Unexpected token." (row#2 => job.company:...)

function es6({ age, name, job.company: company}) {
var yearOfBirth = 2018 - age,
console.log(
${ name } works at ${ company } and was born in ${ yearOfBirth }.);
}

 

That's because of the comma at the end of the assignment.

code of conduct - report abuse