katedobroth / lodash_project

Final project
0 stars 0 forks source link

Summary #1

Open cyouh95 opened 5 years ago

cyouh95 commented 5 years ago

Criteria 1: Functionality

Criteria 2: Formatting

Criteria 3: JavaScript Techniques

Overall Score: 10/12

Great job on this project! Code is overall very well-written and formatted. Great use of loops, control flow statements, as well as all-around adhering to DRY principles. Most methods passes all the tests in the provided test suite, so well done!

There are just a few places where you could simplify/condense your code further. For example, here, it may be a good idea to use the ternary operator:

return arr.slice(typeof n === 'undefined' ? n : 1);

We may also want to specifically check if n is undefined because if n is 0, it would be considered "falsey" as well.

For your chunk() method here, you could also consider using the .push() method to dynamically add to your array:

const chunks = [];

for ( ... ) {
    let c = [];

    while ( ... ) {
        c.push(arr[(chunk*size)+i]);
        i++;
    }

    chunks.push(c);
}

But otherwise, great work overall on this!

As a further challenge, feel free to try implementing more functions from the lodash library and perhaps write your own tests to check them. Have fun! :)

katedobroth commented 5 years ago

When I run node test/test-all.js, all tests pass. So I'm not sure what you mean when you say that most tests pass. image

cyouh95 commented 5 years ago

@katedobroth Ah, there seems to be a small discrepancy in the test suite on the Codecademy platform and the one in the project zip folder that you can download on the project page. Thank you for pointing that out - I will pass that along to the content team!

But here is the project folder you can download from the course page, which contains a couple additional tests for the inRange() method. As noted from the instructions in Step 7, we'd want the inRange() method to return false if "the provided number is smaller than the start value", and true if it is equal to or greater than. Thus, we would want start <= number on this line here.

Nonetheless, excellent work overall on this project! Let us know if you have any additional questions or concerns.