#How to define types in forEach
4 messages · Page 1 of 1 (latest)
Nvm, forgot what Object.entries does
if you really want to add explicit types, you can do
Object.entries({x: 42}).forEach(([k,v]: [string, number]) => …)
what you said was in principle correct tho: usually metrics would should have explicit types and the type within forEach would be inferred implicitely.