Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

[JavaScript] Add new concept exercise: classes-intro #1390

Closed
wants to merge 12 commits into from

Conversation

rishiosaur
Copy link
Contributor

This PR brings in the implementation described in #1325.

@rishiosaur rishiosaur requested a review from a team as a code owner May 1, 2020 16:25
@rishiosaur
Copy link
Contributor Author

NOTE: THIS IS STILL A DRAFT

@SleeplessByte SleeplessByte self-requested a review May 2, 2020 00:39
@SleeplessByte SleeplessByte changed the title Js/concepts/class intro [JavaScript] Add new concept exercise: classes-intro May 2, 2020
@SleeplessByte SleeplessByte marked this pull request as draft May 2, 2020 00:39
@SleeplessByte SleeplessByte added the type/new-exercise Add a new exercise label May 2, 2020
@rishiosaur
Copy link
Contributor Author

Things left to do:

  • Finish instructions
  • Work on constructor and method tests

@rishiosaur
Copy link
Contributor Author

Testing is all done. Now I just need to add in all the instructions

@declarationperfume declarationperfume added the status/draft This issue or pull request is a draft, and not ready for review/merge. label May 6, 2020
@declarationperfume
Copy link

/format

@ErikSchierboom
Copy link
Member

@rishiosaur The main reviewer for the JavaScript track (@SleeplessByte) is temporarily unable to do reviews. It might take a little longer for this to be reviewed. Thanks for the patience!

@rishiosaur
Copy link
Contributor Author

No worries @ErikSchierboom!


```

To add a method (a function of a class) to a class, just write the function definition without the `function` keyword in the class body:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the use of "just"

To add a method (a function of a class) to a class, just write the function definition without the `function` keyword in the class body:

```js
class FunctionDemo {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would see this easier to understand without using the word 'function' in the class name and the methods.


The `this` keyword is a way to access properties and methods on a class's _prototype_. The prototype is a JavaScript object where all properties and methods of a class are stored.

You can access the `this` keyword from anywhere inside any function:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make it clear that "any function" is "any function" that is on the class

console.log(this.property1)
}

myFunction() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would remove the word Function here. Also, is this a time to discuss when to call it a function and when to call it a method?

@ErikSchierboom
Copy link
Member

This Friday (Jan 29th 2021), we're going to explode this repo back into the individual track repositories and archive this repo.

As such, this PR needs to be merged by Friday 9am UTC, or it will need to be manually reopened against the track repo.

@SleeplessByte
Copy link
Member

@rishiosaur if possible, can you rebase? If not I can do it later.

Base automatically changed from master to main February 2, 2021 12:28
@iHiD iHiD closed this Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/draft This issue or pull request is a draft, and not ready for review/merge. track/javascript type/new-exercise Add a new exercise
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants