Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

70
Views
Read json value after Uin8Array conversion to string

Have Uint8Array which is converted to string via

const str = String.fromCharCode(...resp[0][0]);

Console.log produce

str:{"contentType":"image/jpeg","name":"fileUpload","filename":"C:\Users\Admin\AppData\Local\Temp\bd767cae/1927905d3ca2ad2f56136aec0ccba000d024f88b.jpeg","originalName":"WP_20150311_004.jpg"}

Obviously cannot just do console.log(str.filename) in order to see filename value so help appreciated.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

  1. Decode the Uint8Array which holds the valid JSON data
  2. Parse it to a native JS data type

// '{"msg":"hello world"}'
const u8Arr = new Uint8Array([123, 34, 109, 115, 103, 34, 58, 34, 104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 34, 125]);
const json = new TextDecoder().decode(u8Arr);
const data = JSON.parse(json);
console.log(data.msg); // "hello world"

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!