<!DOCTYPE html>
<html>

<head>
  <script src="https://traceur-compiler.googlecode.com/git/bin/traceur.js" data-semver="0.0.0-20140302" data-require="traceur@0.0.0-20140302"></script>
  <script src="https://traceur-compiler.googlecode.com/git/src/bootstrap.js" data-semver="0.0.0-20140302" data-require="traceur@0.0.0-20140302"></script>
  <script>
    traceur.options.experimental = true;
  </script>
  <link rel="stylesheet" href="style.css" />
</head>

<body>
  <script src="script.js" type="module"></script>
  <script src="solve.js" type="module"></script>
  <h1>Exercise 8: Symbols</h1>
  <ol>
    <li>Create a new <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol">Symbol</a>("firstName") and assign it to a variable named firstName. Create a new object literal called person that has only one propety defined by firstName
      and value "Ola".</li>
    <li>Verify that the firstName of person is Ola</li>
    <li>Verify that the string generated by JSON.stringify does not contain any firstName.</li>
    <li>Assign a new Symbol("firstName") to firstName variable, then verify that you can no longer access person's firstName.</li>
    <li>Now try to define a secondName attribute to person, this time using Symbol.for("secondName"). Verify that you can access the secondName by using the a new variable that contains the result of Symbol.for("secondName").</li>
  </ol>
</body>

</html>
// don't change this file
// write your code in solve.js
Exercise 8: Symbols


8a) Create a new Symbol("firstName") and assign it to a variable named firstName. Create a new object literal called person that has only one propety defined by firstName and value "Ola".

8b) Verify that the firstName of person is Ola

8c) Verify that the string generated by JSON.stringify does not contain any firstName.

8d) Assign a new Symbol("firstName") to firstName variable, then verify that you can no longer access person's firstName.

8e) Now try to define a secondName attribute to person, this time using Symbol.for("secondName"). Verify that you can access the secondName by using the a new variable that contains the result of Symbol.for("secondName").
// write here the solution to the exercises