Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if all elements in array are true javascript

You can use `every()` array method 

let data = [ {status: true}, {status: false}, {status: true} ]
let result = data.every((i) => {
	return i.status === true
})
console.log(result) // false

let data = [ {status: true}, {status: true}, {status: true} ]
let result = data.every((i) => {
	return i.status === true
})
console.log(result) // true
 
PREVIOUS NEXT
Tagged: #check #elements #array #true #javascript
ADD COMMENT
Topic
Name
7+7 =