Generation

generate functionTue, 27 Jun 2023

String[][] estudiantes = { {"Otras carreras universitarias"}, {"Prueba de acceso a mayores de 25 años"}, {"Bachiller-EBAU"}, {"Ciclos Formativos de Grado Superior"}, {"COU-Selectividad"}, {"Otras carreras universitarias"}, { "Ciclos Formativos de Grado Superior"}, {"Ciclos Formativos de Grado Superior" }, {"Otras carreras universitarias"}, {"Bachiller-EBAU" }, how many and which variables are repeated from an array

function cleanArray(actual) { var newArray = new Array(); for (var i = 0; i < actual.length; i++) { if (actual[i]) { newArray.push(actual[i]); } } return newArray; } var array = ["a", "b", "c", "d", "a", "b", "c", "f", "g", "h", "a", "b", "c", "f", "g", "h"]; var unique = array.filter(function(elem, index, self) { return index === self.indexOf(elem); }) console.log(unique); // ["a", "b", "c", "d", "f", "g", "h"] var unique = cleanArray(array.filter(function(elem, index, self) { return index === self.indexOf(elem); })) console.log(unique) // ["a", "b", "c", "d", "f", "

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant