// Agregar aquí el código javascript const employees = [ { name: "Ana", sector: "Desarrollo", salary: 150000 }, { name: "Luis", sector: "Diseño", salary: 120000 }, { name: "Marta", sector: "Desarrollo", salary: 160000 }, { name: "Carlos", sector: "RRHH", salary: 110000 }, { name: "Julia", sector: "Diseño", salary: 130000 } ]; const tableContainer = document.getElementById('tableEmployees'); const table = document.createElement('table'); const headerRow = document.createElement('tr'); ['Nombre', 'Sector', 'Salario'].forEach(headerText => { const th = document.createElement('th'); th.textContent = headerText; headerRow.appendChild(th); }); table.appendChild(headerRow); tableContainer.appendChild(table); employees.forEach(employee => { const row = document.createElement('tr'); ['name', 'sector', 'salary'].forEach(key => { const td = document.createElement('td'); td.textContent = employee[key]; row.appendChild(td); }); table.appendChild(row); }); table.appendChild(document.createElement('tr')); // Fila vacía para separación const averageSalary = employees.reduce((sum, emp) => sum + emp.salary, 0) / employees.length; const averageRow = document.createElement('tr'); const averageLabelCell = document.createElement('td'); averageLabelCell.textContent = 'Salario Promedio'; averageRow.appendChild(averageLabelCell); const averageValueCell = document.createElement('td'); averageValueCell.textContent = averageSalary; averageRow.appendChild(averageValueCell); table.appendChild(averageRow);