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 173 views
1 answer 152 views
1 answer 148 views
1 answer 171 views
1 answer 196 views
2 answers 232 views
...