Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

check if any property of object is null javascript

function hasNullProp(obj) {
	for (const key of Object.keys(obj)) {
    	if (obj[key] === null) {
            return true
        }
    }

	return false
}

// Returns true
const hasOneNullProp = hasNullProp({
	foo: 'string',
  	bar: null
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: js id generator 
Javascript :: ionic ngfor in component 
Javascript :: how to call rest api with the useeffect hook in react 
Javascript :: $(this).text() in jquery return white space 
Javascript :: remove all symbols javascript 
Javascript :: react native import svg image 
Javascript :: remove array item from localStorage 
Javascript :: get highest value in array of object javascript 
Javascript :: how to trap js errors window.onerror 
Javascript :: angular add a new line from component 
Javascript :: promise.allsettled polyfill node 
Javascript :: jquery find selected option by class 
Javascript :: delete all the rows of table javascript 
Javascript :: discord.js remove reaction 
Javascript :: javascript change nan to 0 
Javascript :: chartjs min 
Javascript :: prevent default jquery 
Javascript :: pwa angular npm 
Javascript :: append element in a div as first child 
Javascript :: javascript string starts with 
Javascript :: Javascript Regex for non-negative numbers 
Javascript :: javascript get query parameter 
Javascript :: window.location.href is not a function 
Javascript :: Warning: Failed child context type: Invalid child context `virtualizedCell.cellKey` of type 
Javascript :: Internet Speed Checker JavaScript 
Javascript :: jquery ajax get response code 
Javascript :: angular js parse json 
Javascript :: vue cli - Uncaught SyntaxError: Unexpected token < 
Javascript :: regex phone number 
Javascript :: open new window chrome extension 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =