Tarea
unknown
javascript
9 months ago
680 B
30
Indexable
let estudiantes = [] let Estudiante = class { constructor(nombre, apellido, matricula, nota) { this.nombre = nombre this.apellido = apellido this.matricula = matricula this.nota = nota } nombreCompleto() { return this.nombre + ' ' + this.apellido } } estudiantes.push(new Estudiante('Francis', 'Encarnación', '2024-0567', 98)) estudiantes.push(new Estudiante('Hector', 'Encarnación', '2024-0589', 99)) estudiantes.push(new Estudiante('Lenny', 'Gonzalez', '2024-8976', 90)) estudiantes.push(new Estudiante('Luis', 'Soto', '2024-0589', 50)) estudiantes.forEach(e => console.log(e.nombreCompleto()))
Editor is loading...
Leave a Comment