简体   繁体   中英

How to get data from [object,Object ] Js

I am trying to encode data(using btoa() ) send it to a data-base then when i retrieve it and decode it i am unable to access the content i just get an array of [object , Object ]

data = [object Object],[object Object],[object Object],....

output of : JSON.parse(data) =  [object Object]
output of : JSON.parse(JSON.stringify(data)) = "[object,Object]"
output of : data[0] = [ 
output of : actual.hasOwnProperty("key") = false 
i tried : x = `[${data}]` same problem it only read the data object as a string 

so actually i was encoding a js object adding : data = JSON.stringify(data).toString(); solved the problem

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM