Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Parse JSON Array in JavaScript</title> </head> <body> <script> /* Storing multi-line JSON string in a JS variable using the new ES6 template literals */ let json = `{ "fruits": [ "Apple", "Banana", "Strawberry", "Mango" ] }`; // Converting JSON object to JS object let obj = JSON.parse(json); console.log(obj); </script> <p><strong>Note:</strong> Please check out the browser console by pressing the f12 key on the keyboard.</p> </body> </html>