Assessment wanted for OOJS 1 skill test. (Tasks 1-2)

Assessment wanted for OOJS 1 skill test. (Tasks 1-2)

Link to task: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Test_your_skills:_Object-oriented_JavaScript

Links to my code:
Task-1: https://jsfiddle.net/EiNzp/8jp236ku/1/
Task-2: https://jsfiddle.net/EiNzp/czf765os/1/

Thanks :wink:

1 Like

Hi @EiN

  • Task 1: Correct! Is there any specific reason you put a comma at the end of the parameter lists?
  • Task 2: Your use of super() is incorrect. super() is the constructor of the parent. You should put the three values into it instead of assigning them with this.

Let me know when I should take another look at task 2. :slightly_smiling_face:
Michael

1 Like

About the comma at the end of the parameters.
I started using a comma at the end of the parameters inspired by reading this article: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Trailing_commas
So far, of course, this does not help me, because I do not change the parameters and do not introduce anything new, and do not change places. But in the future, as far as I understand, this habit can help me a little in editing and correcting more serious code.

I fix task-2, here is a new link: https://jsfiddle.net/EiNzp/jsrLea2d/1/

Ahhh, I see. Thanks for the link. I can see the value in this especially for object and array declarations.

Great improvement! Now we use the full potential of inheritance. :+1:

1 Like