-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserPratica.js
More file actions
50 lines (37 loc) · 1.13 KB
/
Copy pathUserPratica.js
File metadata and controls
50 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//Se não for exportar, deixar com "class User{". Se for exportar usar o "export default classe User{"
export default class User{
#nome
#email
#nascimento
#role
#ativo
constructor (nome, email, nascimento, role, ativo){
this.#nome = nome
this.#email = email
this.#nascimento = nascimento
this.#role = role || 'estudante'
this.#ativo = ativo || 'true'
}
criarPerfil(){
return `Perfil criado`
}
apagarPerfil(){
return `Perfil deletado`
}
exibirINF(){
return `O usuário ${this.#nome}, nasceu em ${this.#nascimento}, tem o perfil de ${this.#role}, tem o e-mail ${this.email}, e seu perfil está ativo? ${this.ativo}`;
}
exibirListaCursos(){
return`cursos listados`
}
matricularEmCurso(){
return `Aluno ${this.#nome} matriculado`
}
exibirCursosMatriculados(){
return `Lista: cursos matriculados `
}
}
// const novoUser = new User('Sloan', 's@s.com', '2024-01-01');
// //console.log(novoUser);
// //console.log(novoUser.exibirINF());
// console.log(novoUser.matricularEmCurso());