Answers for "convert value to json js"

PHP
12

javascript parse json

const json = '{ "fruit": "pineapple", "fingers": 10 }';
const obj = JSON.parse(json);
console.log(obj.fruit, obj.fingers);
Posted by: Guest on May-20-2020
6

js string to json

var obj = JSON.parse("{no:'u',my:'sql'}");//returnes {no:'u',my:'sql'}
Posted by: Guest on April-08-2020

Browse Popular Code Answers by Language