The fact is that I have this function that creates objects of the Person class and stores them in an array. I create it correctly, the problem I have is that I want to show the value of the object created in an HTML div. This is the constructor of the Person class.
class Persona
constructor(nombre,apellidos,direccion,salarioBruto,salarioNeto){
this._nombre = nombre;
this._apellidos = apellidos;
this._direccion = direccion;
this._salarioBruto = salarioBruto;
this._salarioNeto = salarioNeto;
}
function crear(){
var nombreI = document.getElementById('nombre').value;
var apellidoI = document.getElementById('apellidos').value;
var direccionI = document.getElementById('direccion').value;
var salarioBrutoI = document.getElementById('salarioBruto').value;
var salarioNetoI = document.getElementById('salarioNeto').value;
var bruto = document.getElementById('salarioBruto').value;
var retencion = document.getElementById('retenciones').value;
var neto = bruto*retencion/100;
document.getElementById('salarioNeto').value = neto;
personas[personas.length]=new Persona(nombreI,apellidoI,direccionI,salarioBrutoI,neto,retencion);
console.log(personas);
}