Skip to content

Instantly share code, notes, and snippets.

} // Defining our block
let secret = ‘skedaddle’
let secret = ‘password’
//=> Uncaught SyntaxError: Identifier ‘secret’ has already been defined.
{
const key = 'baby’s first constant';
key = 'changed!'; //=> Uncaught TypeError: Assignment to constant variable..........
const erik = { weight: '155lbs', height: '6 4'};
erik.weight = 185
erik.weight //=> 185
const names = [‘erik’, ‘joe’, ‘sarah’]
const fullNames = names.map(function(name) {
return `${name} is cool’
}
const fullNames2 = names.map((name) => {
return `${name} is cool`;
}
console.log(fullnames2);
//=> => [‘erik is cool’, ‘joe is cool’, ‘sarah is cool’]
const fullNames2 = names.map(name => {
return `${name} is cool’
}
const fullNames3 = names.map(name => `${name} is cool’);
const fullNames3 = names.map(() => `Erik is cool’);