S
S
Sood212020-11-03 12:17:38
typescript
Sood21, 2020-11-03 12:17:38

How to correctly type Object.entries?

I welcome everyone. Tell me how to properly type the [key, value] pair for the acc object

const newFrontAttributes = frontAttributes.map((item: IFrontAttribute) => {
      return Object.entries(item).reduce((acc: Partial<IFrontAttribute>, [key, value]: ??????) => {
        acc[key] = { ...value, ...validate(value.value) };
        return acc;
      }, {});
    });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WbICHA, 2020-11-03
@WblCHA

Object.entries<TYPE>(item)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question