
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
Fetch values by ignoring a specific one in JavaScript?
To ignore a specific value, use the logical Not (!) operator in if condition and fetch watching you want to include.
Example
var customerDetails=[ { customerName:"John", customerAge:28, customerCountryName:"US" }, { customerName:"David", customerAge:25, customerCountryName:"AUS" }, { customerName:"Mike", customerAge:32, customerCountryName:"UK" } ] for(var i=0;i<customerDetails.length;i++){ if(customerDetails[i].customerCountryName!="AUS"){ console.log("The country name is="+customerDetails[i].customerCountryName); } }
To run the above program, you need to use the following command −
node fileName.js.
Here, my file name is demo179.js.
Output
This will produce the following output −
PS C:\Users\Amit\javascript-code> node demo179.js The country name is=US The country name is=UK
- Related Articles
- Fetch specific values from array of objects in JavaScript?
- Fetch specific field values in MongoDB
- Fetch specific documents with array values in MongoD
- JavaScript fetch a specific value with eval()?
- Merge two objects in JavaScript ignoring undefined values
- Accessing array values in a MongoDB collection to fetch a specific document
- Combine two columns by ignoring missing values if exists in one column in R data frame.
- How to fetch a specific row when values are the same in MySQL?
- Fetch alternative even values from a JavaScript array?
- Sort a column ignoring a specific word in MySQL
- Create a random sample by ignoring missing values in an R vector.
- Fetch specific rows from a MySQL table with duplicate column values (names)?
- Fetch the size of a specific column values in MySQL and display the sum
- How to query MongoDB a value with $lte, $in and $not to fetch specific values?
- MySQL query to sort column values and ignoring quotes on one of the values

Advertisements