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

Constructor Functions to Classes
AboutCommentsNotes
Constructor Functions to Classes
Expand for more info
index.js
run
preview
console
function Gamer(name, score){
this.name = name
this.score = score
this.incrementScore = function(){
this.score++
}
}

const dave = new Gamer('Dave', 0)
dave.incrementScore()
console.log(dave)





Console
Gamer {name:
"Dave"
, score:
1
}
,
/index.html
-5:28