Re:A 'CSS reset' for TypeScript, improving types for common ...
by wizofaus on Friday March 03, 2023 @05:52AM
(#35008012)
What's wrong with Object?
[ Parent
| on HN ]
Re:A 'CSS reset' for TypeScript, improving types for common ...
by 9034725985 on Friday March 03, 2023 @06:25AM
(#35008190)
If I set input as Object,
if (input[prefCode] !== null) {
currentValue = input[prefCode].toString();
}
in the lines above, I see a red underline under input[prefCode]> Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Object'. No index signature with a parameter of type 'string' was found on type 'Object'.ts(7053)