How can I convert an object string to an object

Stack Overflow Asked by Insberr on November 22, 2020

How can I convert the string to an Object?

var string = "{ test: 'hello' }";

One Answer

This is very straightforward, please search google before posting.

const obj = JSON.parse(string);

Answered by Victor Oliveira on November 22, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP