const data = {
a: "first",
b: "second",
};
const values = Object.keys(data).map(key => data[key]);
const commaJoinedValues = values.join(",");
console.log(commaJoinedValues);
type Data = {
value: number;
text: string;
};
type textProperty = Data["text"]; //string
//OR
const data = {
value: 123,
text: 'hello'
};
type textProperty = typeof data["text"]; //string