That string is probably the class name of the object. You can get it like so:
console.log(error.constructor.name)
Note: This may or may not work for you depending on how the Error object class was instantiated and whether or not you use a destructive minifier or a code mangler.
Use Object.keys(error)
to get the keys of error
object as an array and then use toString()
to change it to string value:
let error = { SigninError:{id: "el-20003", description: ""} } var keys = Object.keys(error); console.log(keys.toString());
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.