lab-antwerp-1 / home

https://lab-antwerp-1.github.io/home/randomizer
MIT License
3 stars 13 forks source link

Alina: Behavior, Strategy, Implementation/week: 1-3 #247

Open AlinaTaoRao opened 2 years ago

AlinaTaoRao commented 2 years ago

my fork of the exercises repo: solution-write-ups my fork of the exercises repo: behavior-strategy-implementation group exercises repo: practice-code-review

Study Plan

Learning Objectives

AlinaTaoRao commented 2 years ago

Week 1

Check-In

I Need Help With:

What went well?

What went less well?

gelilaa commented 2 years ago

What went less well?

  • there are a long list of array method, but I just know a few of them, so a lot to learn. You can always use MDN docs for reference anytime.
  • write and use callback function. Start experimenting with a simple callback functions ,nothing fancy. Once you get hang of it, you can write more complex ones.
AlinaTaoRao commented 2 years ago

@gelilaa

You can always use MDN docs for reference anytime.

Start experimenting with a simple callback functions

Very useful advice. Thanks! πŸ˜ƒ

AlinaTaoRao commented 2 years ago

Week 2

Check-In

I Need Help With:

  1. write unit test with try, catch, toThrow
  2. About library, jest. New for me. How deep should I know about it?

    What went well?

What went less well?

Lessons Learned

Sunday Prep Work

colevandersWands commented 2 years ago

write unit test with try, catch, toThrow

These are both πŸ” learning objectives, you don't need to know them. If you have time you can keep studying this but only after you're comfortable with everything else.

About library, jest. New for me. How deep should I know about it?

All you need to know deeply for now is describe, it, and expect(_).toEqual(_). There is the npm command for running tests from VSCode, that uses Jest but you don't need to understand how Jest works. Just how to read the test results

AlinaTaoRao commented 2 years ago

@colevandersWands Thanks for your answer. Now I can confidently focus on those basic but essential exercises. πŸ˜„

AlinaTaoRao commented 2 years ago

Week 3

Check-In

I Need Help With:

  1. I wrote this function as solution to solve sort numbers. For me continue is logical in this function, but when I made PR , Lint-CI throw error: "Unexpected use of continue statement (no-continue)", why? Is this a problem from continue or it's a problem from continue in this function. my PR
const sortNumbers3 = (number = []) => {
  const copyOfNumber = number.map((x) => x);
  // sort the copyOfNumber
  for (let j=1; j<copyOfNumber.length; j++) { 
    let i;
    for(i=0; i<j; i++) {
    // find the one that is larger than copyOfNumber[j]
      if (copyOfNumber[j] < copyOfNumber[i]) {                
         break;
       }
    }

    if(i===j) {continue;} // error: Unexpected use of continue statement (no-continue)

    // insert copyOfNumber[j]
    const temp = copyOfNumber[j];
    for(let k=j-1; k>=i; k--) { // shift one position to right
      copyOfNumber[k+1] = copyOfNumber[k]
    }
    copyOfNumber[i]= temp; // insert copyOfNumber[j]
    }

    return copyOfNumber;
};

What went well?

practice-code-review. I joined a study group and it helps me to adapt to the git workflow.

What went less well?

Read and fix lint: CI errors.

Lessons Learned

Many ways to handle lint-CI error from study group. Save me a lot of time.

Sunday Prep Work

colevandersWands commented 2 years ago

but when I made PR , Lint-CI throw error: "Unexpected use of continue statement (no-continue)", why?

Continue is ok, it must be a configuration option I missed. Linting tools in JS land can get complicated, I'll update this rule in the repo and you can ignore it for now

AlinaTaoRao commented 2 years ago

@colevandersWands Thanks for your answer. πŸ‘