- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Method to check if array element contains a false value in JavaScript?
To check if array element contains a false value, you can use the Object.values() in JavaScript. Following is the code −
Example
const details = [ { customerDetails: [ { isMarried: true }, { isMarried: true } ] }, { customerDetails: [ { isMarried: true }, { isMarried: true } ] } ] const isNotMarried = Object.values(details) .some(({customerDetails})=>customerDetails.some(({isMarried})=>!isMarrie d)); console.log(isNotMarried);
To run the above program, you need to use the following command −
node fileName.js.
Here, my file name is demo75.js.
Output
This will produce the following output −
PS C:\Users\Amit\JavaScript-code> node demo75.js false
- Related Articles
- Java Program to Check if An Array Contains a Given Value
- Golang Program to Check if An Array Contains a Given Value
- Check if object contains all keys in JavaScript array
- How to check if an array contains integer values in JavaScript ?
- Java Program to Check if An Array Contains the Given Value
- Check if a Stack contains an element in C#
- How to check if a slice contains an element in Golang?
- How to check which list element contains a particular value in R?
- Display in console if Select list value contains a value from an array in JavaScript?
- Check if a HashSet contains the specified element in C#
- Check if the SortedSet contains a specific element in C#
- How to check if a vector contains a given value in R?
- Check if the Hashtable contains a specific value in C#
- Check if the StringDictionary contains a specific value in C#
- Check if a value exists in an array and get the next value JavaScript

Advertisements