function filter(list, text, parameter) { return list.filter(el=>el[parameter].includes(text)); } let b = filter(list ,textarea, "age");