I'm trying to join all values from an object to semi colon separation, it works fine if the object is just one level:
obj = {
name: "one"
additionalInfo: "hello"
...
};
Object.values(obj).join(';')
Result: one;hello
But if the object is nested:
obj = {
name: "one"
additionalInfo: {
description: "hello",
...
}
};
Object.values(obj).join(';')
Result: one;[object Object]
The rest of the values except name is of course [object Object]. How can I join the level 2 values also?
The result I want is:
one;hello