How to access a method from a class from another class?
<p>I want to use Object Oriented Programming technique with JavaScript but I can't access a method from one class from another class. How can do like the following?</p>

<pre><code>class one{

  write(){
    console.log("Yes! I did!");
  }
}

class two{
   var object=new one();

   tryingMethod(){
   object.write();
   }
}
</code></pre>

<p>I get the following error:</p>

<blockquote>
  <p>Uncaught SyntaxError: Unexpected identifier -->> for  <code>var object=new one();</code></p>
</blockquote>