Sprint-Challenge--JavaScript - #244
Conversation
indifferentghost
left a comment
There was a problem hiding this comment.
Great
Your syntax and understanding has greatly improved! I'm happy to see that you're using class syntax perfectly!
Requested Improvements
Relatively speaking I'd just suggest watching what variables you're using.
Questions
How do you feel about JS after you had time to mull over it for the weekend?
Rating: {1-3}
2
| class Cube extends CuboidMaker { | ||
| constructor(cubeValues) { | ||
| super(CuboidValues); | ||
| this.isCube = cubeValues.isCube; |
There was a problem hiding this comment.
You're defining cubeValues in the constructor, but passing CuboidValues to the super. I believe you're passing undefined.
| return `We have a cube!`; | ||
| } | ||
|
|
||
| return surfaceArea; |
There was a problem hiding this comment.
returning surfaceArea is going to return undefined. You should probably returning something like 'We don't have a cube'.
| const each = (elements, cb) => { | ||
| // Iterates over a list of elements, yielding each in turn to the `cb` function. | ||
| // This only needs to work with arrays. | ||
| elements.forEach(cb); |
There was a problem hiding this comment.
While it wasn't explicitly stated in the instructions, the hope was to do each of these without using array methods.
|
|
||
| /* ======================== Class Practice ============================ */ | ||
| CuboidMaker.prototype.surfaceArea = function () { | ||
| return `SurfaceArea: ${2 * (this.length * this.width + this.length * this.height + this.width * this.height)}`; |
There was a problem hiding this comment.
It doesn't look like you're closing this function fully. I don't see a matching curly bracket from the opening function.
No description provided.