scrimba
JS Deep Dive
Classes
What Are 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

What Are Constructor Functions?
AboutCommentsNotes
What Are Constructor Functions?
Expand for more info
index.js
run
preview
console
const student1 = {
id: 1,
name: "Reed",
subjects: [],
addSubject(subject) {
this.subjects = [...this.subjects, subject];
}
}
Console
index.html
-10:30