Hacker News new | past | comments | ask | show | jobs | submit login

It's the class constructor function.

Something like:

  Function Circle(){}
  
  Circle.circlesMade(val) = function circlesMade(val){
    this._count = val;
  }



That's strange, coming from Java.


That's a validation of some of the other discussion in the thread. JavaScript gets a 'class' keyword, but it's really just syntactic sugar over prototypical inheritance. So there is some misunderstanding about what it does and doesn't do.

That said, it could have also been written as:

  static set circlesMade(val) {
        Circle._count = val;
  };
which means the exact same thing, and would maybe help people to understand that "_count" is just like a static class property on the Circle "class"




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: