showing results for - "javascript check if any value in array is true"
Paola
01 Sep 2018
1let boolArray1 = [true, false, false]
2let boolArray2 = [false, false, false]
3
4boolArray1.some(x => x);  // true
5boolArray2.some(x => x);  // false
6
7// Example of using a function to evaluate array
8let numberArray = [1, 2, 3, 4, 5];
9let oddNumbers = [1, 3, 5, 7, 9];
10
11// checks whether an element is even
12const even = (element) => element % 2 === 0;
13
14numberArray.some(even);  // true
15oddNumbers.some(even);   // false
16
Clémence
09 Mar 2020
1You can use `every()` array method 
2
3let data = [ {status: true}, {status: false}, {status: true} ]
4let result = data.every((i) => {
5	return i.status === true
6})
7console.log(result) // false
8
9let data = [ {status: true}, {status: true}, {status: true} ]
10let result = data.every((i) => {
11	return i.status === true
12})
13console.log(result) // true
queries leading to this page
check array is truecheck if all true in array jscheck if all in array truecheck if every element in array is truejavascript check if all elements in array are true or falsearray contains true or falseif array contains true or falsecheck if all array elements are truecheck if some values in array are true javascriptcheck if an array only contains true jshow to check if all the values present in an array are true in javascripthow to check specific items in array are true javascriptjs check if all elements in array are truefrom all array elements if one element is true then condition returns falseif any array element is truereturn true if value is an array javascriptif array has value javascript return truejs check if any of list is truejavascript check if all elements in array are truejavascript array check if all values are truejavascript return true if element in arrayjavascript return true if value is in arraycheck if any value in array is true jscheck if all values in array are false javascriptjavascript if value in array is truecheck if there is a true in an arrayif all in list are true javascirptjavascript array is all truecheck if array has true in it in javascriptreturn true if element is in an arrayjs check if array contains truejs if all array truehow to check array or not in javascriptes6 check if array contains truecheck if one of the values in array are true javascriptcheck if all array s true jscheck array has true value in jsjavascript array check if any value is truejavascript if one array item is truejs if array trueall values in array is true javascripthow to check if all elements in an array are truejs check if no true in arrayfind if value is true in array jscheck if array is truehow to check if all values in array are true javascriptjs check if values are true in arrayjavascript if all items in array are truejavascript check if all items in array are truecheck for true or false in array javascriptcheck if all array values are true javascripthow to check all elements in array are truehow to determine if every value in an array is true jshow to validate all array values are true in javascripthow to checkl if all elements in array are true javascriptif an array is true javascriptcheck if every value in array is truecheck if any values in array are true javascripttest if array have false value javascriptjavascript array check if any element getting true than resturncheck if all item sin array are truecheck if condition is true in entire array javascriptif array has value javascript return true es6javascript check if any value in array is falseif all is true javascript in arraycheck which value is true from arraycheck if any condition in array is true jsjs check if all array values are truecheck all items of array is truecheck if any of the items in an array is truereturn true if array has a valuechecking if an array is truehow to check if all array element is one is true or false in javascripthow to check all value is true in array in javascriptcheck if one value in array is truecheck array for true false javascripthow to find the value is true or not in array in javascriptcheck all values in array are true jsif the array conain something return true jsif exists in array javascript return true false check if all elements in array are trueif all in array is truejavascript check if every value in array is truejavascript true if var in arrayjs array if any element true return truecheck if all elements in array is truehow to check if all item of array is true javascriptjavascript check if any in array is truehow to check if any of the value of array is true typescriptcheck if any expressions in an array are true jsjavascript function that checks if all elements in the array are true or falsetypescript check if all values in array are truearray method to find if all value is true javascriptvalidate array with true value javascriptjs check if not true in arrayjs true if in listhow to check if a element is false in array jsarray if one true jscheck every element in array is truecontrol if an array have a true value jsjavascript return true if find in arrayif any values in the array are false javascriptjavascript check if an element in array is truecheck if there true in an array javascriptuse expect to check for true value in an array javascriptcheck if an y element in array is true javascriptjavascript check that all values in array are truecheck if all values in array is true jsmethod to check if there any value in array is true javascriptcheck is a value in array is true in node jsjs array check if contains truejs check if all items are true in arrayhow to find if every element of an array is true of not in javascropotjavascript check if all values in array are falsejavascript check if all array values are truecheck if all elements of array are truearray contains element true false in javascriptif in an array true 2c if not in an array false javascriptcheck if all values are true in array javascriptcheck array all false in array javascriptcheck every item is true javascriptcheck all elements in array are truejavascript if one element is true in arraytrue if all array values jscheck if all elements in array are true javascriptjs all elements in array truejavascript check if all values in array are true return somethingcheck if one value false array javascriptcheck all true js arrayhow to see if 5b0 5d in array is true javasripthow to check if all items in array is false jshow to check array value is same or not in javascriptreturns true or false if is in teh array javascriptcheck if all values in array are truejavascript all elements in array are truecheck array for any false valuecontrol if an array have a true valuemake true if any one of array is true javascriptjs array check if all truees6 check if array contains falsejavascript check if any value in array is truejs return true if item in arrayhow to check if all values in an array are true jsjavascript if array is truehow to check true in array javascriptjs false in arrayhow to check if all array element is true or false in javascriptarray check all truecheck if true value in array jscheck if all elements in array are true jscheck in all array is truehow to find if array method return true or falsereturn true if any item in array is truejs check if all array values is truejavascript check all values in array are truecheck if array has true value javascripthow to check item in array are true or false javascriptjavascript any item in array is truejavascript array check if all truecheck if all value in a list is true jsjs check if everything in array is truehow to check if array there one item is true so return true in javascriptcheck if a value is true in arrayif one element in array return true jscheck if all are true array function javascriptjs exists in array return array of true or falsejs check if any one item in a list is truejavascript check if one value is false arrayif value in list then true jshow javascript return true if array has differnt valuesjavascript array return true or false if existscheck if any value in array is trueif element is in array 2c return true javascriptreturn item in an array if conditions is true in jsjavascript return true if the value is an array 2c false if otherwise js check if array is all truejs check if array includes only true valuesjavascript find if any element in array is truejavascript array find check if condition is truehow to check if an array of true and false contains true value javascripitreturn true if in array javascriptjavascript check if every element in array is truecheck if all element in array are truehow to check with array values in if conditions in javascriptreturn true if array has value javascriptreturn true if the value is an array javascriptcheck if any value in array is true javascripthow to condition data of array 1 has not any data in jscheck if all items in array are true javascriptjavascript return true if elelement is in arrayhow to check one of the array value is true in javascriptcheck if all values in an array are truereturn true if array has valuejacscript check if mor than one value is true in arraycheck if value in array is false javascriptcheck all values in array equal true javascriptjs if all elements in array truehow to check each element in array if truetrue or false if array has valuejs check if all values in array are truecheck if all values in array are true jscheck any true javascritp arraycheck in array any value is true or false javascriptcheck if all values in array are true javascriptjavascript check if all values in array are truejs if array contains return truehow to check array that has true valuecheck if all values of an array are truehow to condition array 0 has not any data in jsjavascript array contains falsecheck if there is a true element in arrau jsif all elements in array are falsecheck if all eleentsof arrayare false javascriptjavascript check if all array element value is falsejavascript check if any value in array is true