Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

filter object js

const raw = {
  item1: { key: 'sdfd', value:'sdfd' },
  item2: { key: 'sdfd', value:'sdfd' },
  item3: { key: 'sdfd', value:'sdfd' }
};

const allowed = ['item1', 'item3'];

const object = Object.fromEntries(
	Object.entries(tt).filter(([key, value]) => currentInputs.includes(key))
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #filter #object #js
ADD COMMENT
Topic
Name
8+9 =