Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
  const avengers = {
    members: [
      {
        name: "Spider-Man",
        alias: "Peter Parker"
      },
      {
        name: "Black Widow",
        alias: "Natasha Romanova"
      }
    ]
  }
  // convert object into a JSON string
  const jsonString = JSON.stringify(avengers)
  console.log(`value of jsonString: ${jsonString}`)
  console.log(`data type of jsonString: ${typeof jsonString}`) // result: string
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x