Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js match property

export const matchProperty = (data: Record<string, any>, compare: Record<string, any>): boolean => {
	let compareIn = Object.keys(compare)
	const newInData = compareIn.map((v) => `${v}` in data)
	return newInData.includes(false) ? false : true
}
 
PREVIOUS NEXT
Tagged: #js #match #property
ADD COMMENT
Topic
Name
3+4 =