Javascript - 在单个字符串中的单独行上返回对象的值

EDJ*_*EDJ 1 javascript string object

我有以下对象:

const parent = {
   "name": "John",
   "age": 35,
   "relationship": "married"
}
Run Code Online (Sandbox Code Playgroud)

我想parent在单个字符串中的单独行上获取属性的所有值,例如:

John
35
married
Run Code Online (Sandbox Code Playgroud)

时间效率对我来说至关重要,因为我将使用数千个对象,每个对象具有超过10万个属性.

小智 5

关于什么

Object.values(parent).join("\n");
Run Code Online (Sandbox Code Playgroud)