Want to use Object.values with typescript? You can use Object.keys instead of Object.values in typescript.
1 2 3 4 5 6 7 8 9 |
const data = { a: "first", b: "second", }; const values = Object.keys(data).map(key => data[key]); const commaJoinedValues = values.join(","); console.log(commaJoinedValues); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.