scrimba
Frontend Career Path
Essential JavaScript concepts
JS Mini Projects
Objects to Constructor Functions
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

Objects to Constructor Functions
AboutCommentsNotes
Objects to Constructor Functions
Expand for more info
index.js
run
preview
console
const gamer = {
name: 'Dave',
score: 0,
incrementScore: function(){
this.score++
}
}

const gamer1 = {
name: 'Sarah',
score: 0,
incrementScore: function(){
this.score++
}
}


Console
Character {name:
"Merlin"
, items:
[]
}
,
"Merlin now has fridge"
,
"Merlin now has fridge, horse"
,
Character {name:
"Merlin"
, items:
[
"fridge"
,
"horse"
]
}
,
/index.html
-4:36