📌  相关文章
📜  过滤对象 js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:47.599000             🧑  作者: Mango

代码示例3
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))
);