Parse JSON string without JSON.parse and eval()
Sandeep kamboj
Posted on July 14, 2018
var jsonStr="{name:'abc',age:20}";
var jsonObject = (new Function( "return " + jsonStr ) )() ;
console.log(jsonObject);
💖 💪 🙅 🚩
Sandeep kamboj
Posted on July 14, 2018
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
javascript Understand JavaScript Object References and Copying - Brief Explanation
November 22, 2024
sql Best Practices for Using GROUP BY in MySQL for Converting Vertical Data to JSON
November 22, 2024