javascript text to object code example Example 1: json_decode javascript JSON.parse(jsonToDecode) Example 2: js string to object JSON.parse()