TECNOLOGIAS PARA A INTERNET II


Analise o trecho de código JavaScript a seguir.

class Pessoa {
  constructor (nome, cpf) {
    this.nome = nome;
    this.cpf = cpf;
  }

  getNome () {
    return this.nome;
  }

  getCpf () {
    return this.cpf;
  }
}

const alguem = new Pessoa('Pedro');

console.log(alguem.getNome()) ;

Assinale a alternativa com a saída correta na console.

 




  • Error

  • Undefined

  • Null

  • Pedro

  • CPF is not Null