DEV Community

Discussion on: Make Your Code Cleaner, Shorter and Easier to Read! ES6 Tips and Tricks.

Collapse
 
gutem profile image
Gutem

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 + '.';
Collapse
 
samwsoftware profile image
Sam Williams

Thanks, the dev.to community is so observant