Answers for "typescript value from object"

0

typescript get object value

const data = {
  a: "first",
  b: "second",
};

const values = Object.keys(data).map(key => data[key]);

const commaJoinedValues = values.join(",");
console.log(commaJoinedValues);
Posted by: Guest on November-05-2021
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 "typescript value from object"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language