V3: [JavaScript] Implement new Concept Exercise: concept/classes-intermediate

Created on 25 Apr 2020  ·  10Comments  ·  Source: exercism/v3

This issue describes how to implement the class concept exercise for the JavaScript track and is a continuation of #1325 .

Getting started

Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:

Please also watch the following video:

Goal

The goal of this exercise is to teach the student how to consume classes and their properties/methods both from static and instantiation standpoints within JavaScript.

Learning objectives

  • Understand the new keyword.
  • Understand the static keyword.
  • Understand how to consume instance methods and fields
  • Understand how to consume static methods.

Out of scope

  • Factory functions
  • Class expressions (declaring a class with a var statement)
  • Static properties & static methods
  • extends keyword
  • Class inheritance with super
  • Class properties (get, set, and Object.defineProperty)

Concepts

  • Class instantiation with the new keyword
  • Accessing class properties from outside of a class
  • Calling class methods from outside of a class
  • Calling static methods from outside of a class

Prerequisites

  • classes-intro
  • booleans
  • numbers
  • strings

Resources to refer to

Hints

_Note: most resources also include inheritance and so suggestions are welcome for resources that expressly tackle the goals without venturing out of scope._

After

_Note: most resources also include inheritance and so suggestions are welcome for resources that expressly tackle the goals without venturing out of scope._

  • MDN class fields - after because it goes out of scope and touches on TC39 proposals (possibly a bad resource?)

Representer

No changes needed.

Analyzer

No changes needed.

Implementing

See the Implementation Guide for JavaScript Concept Exercises for more details.

Help

If you have any questions while implementing the exercise, please post the questions as comments in this issue.

statuhelp-wanted typnew-exercise

All 10 comments

@rishiosaur - Tagging you for continuity

@Tbhesswebber I think we should include static properties and methods in this exercise.

@Tbhesswebber I think we should include static properties and methods in this exercise.

Just to clarify, @rishiosaur, did you mean "should" or "shouldn't"?

Until static properties have landed (https://github.com/tc39/proposal-class-fields#class-field-declarations-for-javascript), I rather not have them as exercises until then, because we will need to handle the syntax, which is "fragile".

@SleeplessByte - I totally forgot that you can't do static properties with class syntax in JS yet (I'm one of those weirdos who actually prefers pseudoclassical syntax). I removed static properties from the concepts and learning objectives.

@rishiosaur and @Tbhesswebber how is it going? Excited to see this exercise 🗡️

@SleeplessByte PR coming for classes-intro soon! Just finishing up the tests.

It might be helpful to have a DRAFT PR up there already, before you put all the work in the tests. But I'm, okay with either approach.

Intermediate one is currently at a standstill. Some work stuff came up and I am now the only person working on what needs to be delivered in a week.

Good luck! We'll see you after 🍡

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tehsphinx picture tehsphinx  ·  4Comments

tehsphinx picture tehsphinx  ·  6Comments

SleeplessByte picture SleeplessByte  ·  7Comments

ErikSchierboom picture ErikSchierboom  ·  6Comments

fpetru picture fpetru  ·  5Comments