Answers for "ts object field from variable"

1

ts object field from variable

// use braces to access an object field from a variable
// use keyof to remove the 'any' type error

activeVideo = videos[target.value as keyof IVideoData];
Posted by: Guest on July-13-2021

Code answers related to "ts object field from variable"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language