Can you help with fixing this issue?
- "How do I resolve the error: 'Element implicitly has an 'any' type because expression of type 'any' can't be used to index type?' "
What could be causing this problem? Can you explain what an index type is? Below is the code snippet in question:
const getPast = action => {
const presentToPast = {
approve: 'approved',
reject: 'rejected',
edit: 'edited',
create: 'created'
};
return presentToPast[action];
};