class.expect.txt 656 B

1234567891011
  1. <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Car</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Vehicle</span> </span>{
  2. <span class="hljs-keyword">constructor</span>(speed, cost) {
  3. <span class="hljs-keyword">super</span>(speed);
  4. <span class="hljs-keyword">var</span> c = <span class="hljs-built_in">Symbol</span>(<span class="hljs-string">'cost'</span>);
  5. <span class="hljs-keyword">this</span>[c] = cost;
  6. <span class="hljs-keyword">this</span>.intro = <span class="hljs-string">`This is a car runs at
  7. <span class="hljs-subst">${speed}</span>.`</span>;
  8. }
  9. }