Contenido del Curso
Object-Oriented Programming in JavaScript
Object-Oriented Programming in JavaScript
Class Attributes
Attributes are some variables inside the class that describe each object. Let’s demonstrate it with two classes – Rectangle
and Student
.
We can represent Rectangle
by its height and width. Add these Attributes to the class definition:
If you need to describe student in some way, you can create class Student
with attributes like, for example, name and university.
Tarea
Add more attributes to the class Student
: age
and gpa
variables.
Tarea
Add more attributes to the class Student
: age
and gpa
variables.
¿Todo estuvo claro?
Class Attributes
Attributes are some variables inside the class that describe each object. Let’s demonstrate it with two classes – Rectangle
and Student
.
We can represent Rectangle
by its height and width. Add these Attributes to the class definition:
If you need to describe student in some way, you can create class Student
with attributes like, for example, name and university.
Tarea
Add more attributes to the class Student
: age
and gpa
variables.
Tarea
Add more attributes to the class Student
: age
and gpa
variables.
¿Todo estuvo claro?
Class Attributes
Attributes are some variables inside the class that describe each object. Let’s demonstrate it with two classes – Rectangle
and Student
.
We can represent Rectangle
by its height and width. Add these Attributes to the class definition:
If you need to describe student in some way, you can create class Student
with attributes like, for example, name and university.
Tarea
Add more attributes to the class Student
: age
and gpa
variables.
Tarea
Add more attributes to the class Student
: age
and gpa
variables.
¿Todo estuvo claro?
Attributes are some variables inside the class that describe each object. Let’s demonstrate it with two classes – Rectangle
and Student
.
We can represent Rectangle
by its height and width. Add these Attributes to the class definition:
If you need to describe student in some way, you can create class Student
with attributes like, for example, name and university.
Tarea
Add more attributes to the class Student
: age
and gpa
variables.