MCPcopy Create free account
hub / github.com/digitalinnovationone/javascript-developer-m1 / Pessoa

Class Pessoa

05 - objetos/aula.js:2–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1
2class Pessoa {
3 nome;
4 idade;
5 anoDeNascimento;
6
7 constructor(nome, idade) {
8 this.nome = nome;
9 this.idade = idade;
10 this.anoDeNascimento = 2022 - idade;
11 }
12
13 descrever() {
14 console.log(`Meu nome é ${this.nome} e minha idade é ${this.idade}`);
15 }
16}
17
18function compararPessoas(p1, p2) {
19 if (p1.idade > p2.idade) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected