JavaScriptJavaScript · Lesson 16

ES6+ Essentials

Modules, classes, spread, optional chaining and modern syntax.

Video tutorialTrack course · freeCodeCamp
Speed
Next lesson
Watch 00:00 · 1 checkpoints Watch on YouTube More on this topic
Transcript & captions
3/3
jsjs
// modules
export function add(a, b) { return a + b; }
import { add } from './math.js';

// classes
class Player {
  #secret = 'hidden';
  constructor(id, level) { this.id = id; this.level = level; }
  get tag() { return this.id.toUpperCase(); }
  static create(id) { return new Player(id, 1); }
}
Try it yourself

Knowledge check

0/1 answered

Which keyword accesses the parent class implementation?