How to convert JSON to an object in JavaScript

1 Answer

0 votes
const json = '{"name":"Tom","age":56,"profession":"Developer"}';

const obj = JSON.parse(json);

console.log(obj);
 
 
 
   
/*
run:
 
{ name: 'Tom', age: 56, profession: 'Developer' }
 
*/

 



answered Mar 21, 2020 by avibootz

Related questions

1 answer 180 views
1 answer 160 views
1 answer 155 views
1 answer 176 views
1 answer 201 views
2 answers 239 views
...