.filter
должен возвращать булево значение. TRUE - оставить элемент, FALSE - удалить
Если все условия должны совпасть, то:
function Validation(arr) {
return arr.filter((el) => {
return typeof el.age === "number"
&& el.full_name !== undefined
&& el.full_name.charAt(0) === el.full_name.charAt(0).toUpperCase()
&& el.gender !== undefined
&& el.gender.charAt(0) === el.gender.charAt(0).toUpperCase()
&& el.note !== undefined
&& el.note.charAt(0) === el.note.charAt(0).toUpperCase()
&& el.state !== undefined
&& el.state.charAt(0) === el.state.charAt(0).toUpperCase()
&& el.city !== undefined
&& el.city.charAt(0) === el.city.charAt(0).toUpperCase()
&& el.country !== undefined
&& el.country.charAt(0) === el.country.charAt(0).toUpperCase()
}
function firstLetterIsUpper(str) {
return typeof(str) === 'string'
&& str.length
&& str.charAt(0) === str.charAt(0).toUpperCase()
}
function Validation(arr) {
return arr.filter((el) => {
return typeof el.age === "number"
&& firstLetterIsUpper(el?.full_name)
&& firstLetterIsUpper(el?.gender)
&& firstLetterIsUpper(el?.note)
&& firstLetterIsUpper(el?.state)
&& firstLetterIsUpper(el?.city)
&& firstLetterIsUpper(el?.country)
}