Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
96
rated 0 times [  103] [ 7]  / answers: 1 / hits: 17862  / 7 Years ago, tue, december 19, 2017, 12:00:00

Good morning . I need help on checking if object exists and certain propertie have value of true. Ex:



validations={
DSP_INDICADOR: {
required: true
},
EMPRESA: {
required: true
},
.....
NOME_AVAL: {
required: false,
notEqualToField: NOME
}
}


and then check for required:true



Thanks in advance


More From » arrays

 Answers
6

I guess this would be it.



if (validations[EMPRESA] && validations[EMPRESA].required) {
console.log(true)
} else {
console.log(false)
}

[#55638] Saturday, December 16, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
maxinec

Total Points: 117
Total Questions: 116
Total Answers: 116

Location: Bangladesh
Member since Sat, Jan 23, 2021
3 Years ago
;