scrimba
Frontend Career Path
Essential JavaScript concepts
JS Mini Projects
Short-circuiting with OR (||) Challenge
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Short-circuiting with OR (||) Challenge
AboutCommentsNotes
Short-circuiting with OR (||) Challenge
Expand for more info
index.js
run
preview
console
const jobHunter = {
name: 'Tom Chant',
username: 'TChant44',
workLocation: 'Europe',
}

/*
Challenge:
1. Make it so that if the jobHunter object does not have
a name property, the username is used instead.
*/

// Complete this line of code 👇
const jobHunterName =

console.log(`Hey ${jobHunterName}!`)
Console
!
ReferenceError: Cannot access 'jobHunterName' before initialization
,
/index.html
-2:14