Tengo otro problema, intento eliminar un elemento de un array y me ocurre que me salta una excepcion
$('.elemento').click(function () {
if (checkValue($(this).val(), checks)) {
console.log('this', $(this).val());
checks = jQuery.grep(checks, function (value) {
console.log('value',value);
return value != $(this).val();
});
} else {
checks.push($(this).val());
}
console.log("checks", checks);
});
y la excepcion es:
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined