Open
Conversation
Git-Leon
reviewed
Jun 29, 2020
Contributor
Git-Leon
left a comment
There was a problem hiding this comment.
pretty good.
You know fundamentals, but definitely need to work on code-reuse to minimize code redundancies.
|
|
||
| function getBox(width, height) { | ||
| // TODO - write method definition here | ||
|
|
Contributor
There was a problem hiding this comment.
Not bad! Not a huge fan of the implementation though.
Consider code-reuse.
It is less redundant to reuse code that has already been written to perform what you need.
It could be more simply expressed as
function getBox(width, height) {
let output="";
for(let i=0;i<height;i++) {
output += getLine(width) + "\n";
}
return output;
}
Author
There was a problem hiding this comment.
I definitely know i have this issue when coding. I have been getting better at seeing when I start using redundant coding(it is easy to catch when I start copying and pasting lol). I was not sure how to make a new function in JS to try and stick the redundant code in.
assets/js/shapes.js
Outdated
| else if(length - count == 2){ | ||
| pyramid += " "; | ||
| } | ||
| else{ |
added 2 commits
June 29, 2020 16:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.