loading...

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

FULL DISCUSSION
 

2 typos:

var fName = 'Peter', sName = 'Smith', age = 43, job: 'photographer';
var a = 'Hi, I'm ' + fName + ' ' + sName + ', I'm ' + age + ' and work as a ' + job + '.';

Change the ":" at job assigment to "=" and escape all single quotes inside the var a or use double quotes starting/finishing.

var fName = 'Peter', sName = 'Smith', age = 43, job = 'photographer';
var a = 'Hi, I\'m ' + fName + ' ' + sName + ', I\'m ' + age + ' and work as a ' + job + '.';
 

Thanks, the dev.to community is so observant

Code of Conduct Report abuse