Comment

Comment by azangru

The example with the Person class suggests that the author is unaware of JavaScript getters:

  class Person {

    get isImmortal() {
      return false; // noone is immortal
    }

  }

  p = new Person();

  p.isImmortal

  // >>> false

  p.isImmortal = true;

  p.isImmortal
  // >>> false

I mean, even plain untyped JavaScript can do that!
parent azangru 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton