node js function return [object Object] instead of a string value

后端 未结 3 1172
孤城傲影
孤城傲影 2021-02-05 20:43

i am quiet new to java script and node js, i am trying to get a value from a MySQL DB, and the return value is [object Object] instead of a string. i didn\'t really found any a

3条回答
  •  天命终不由人
    2021-02-05 21:29

    Use one of the options:

    console.log("%o", yourObjName)
    console.log(JSON.stringify(yourObjName))
    console.log(JSON.stringify(yourObjName, null, 3))

提交回复
热议问题