lab-brussels-1 / home

Home repository for Lab Brussels 1.
https://lab-brussels-1.github.io/home
MIT License
4 stars 5 forks source link

Dnyandeo : inside JS - 4 weeks #324

Open Dnyandeo33 opened 2 years ago

Dnyandeo33 commented 2 years ago

Inside JS


Learning Objectives

Priorities: πŸ₯š, 🐣, πŸ₯, πŸ” (click to learn more)
There is a lot to learn in this repository. If you can't master all the material at once, that's expected! Anything you don't master now will always be waiting for you to review when you need it. These 4 emoji's will help you prioritize your study time and to measure your progress: - πŸ₯š: Understanding this material is required, it covers the base skills you'll need to move on. You do not need to finish all of them but should feel comfortable that you could with enough time. - 🐣: You have started all of these exercises and feel you could complete them all if you just had more time. It may not be easy for you but with effort you can make it through. - πŸ₯: You have studied the examples and started some exercises if you had time. You should have a big-picture understanding of these concepts/skills, but may not be confident completing the exercises. - πŸ”: These concepts or skills are not necessary but are related to this module. If you are finished with πŸ₯š, 🐣 and πŸ₯ you can use the πŸ” exercises to push yourself without getting distracted from the module's main objectives. ---

0. Asserting

1. Primitives and Operators

2. Control Flow

3. Functions

5. Unit Testing

6. ES Modules

6. Using Functions

7. Arrays

8. Functional Array Methods

9. Objects

Dnyandeo33 commented 2 years ago

Week 1

I Need Help With:

What went well?

What went less well?

Sunday Prep Work

colevandersWands commented 2 years ago

Documenting Functions - Understanding-wise okay but writing-wise not okay.

It's not easy to read, understand and explain what a function does. This will take time to master which is why we introduce it early

Dnyandeo33 commented 2 years ago

@colevandersWands Thank you so much, Your comment always inspire me. ,☺️☺️

danielhalasz commented 2 years ago

@Dnyandeo33 and while documentation makes life easier in many projects, it is also ok not to use it in some cases :)

danielhalasz commented 2 years ago
  • How to use console.assert instead of console.log

and these two have different purposes

Dnyandeo33 commented 2 years ago

Week 2

I Need Help With:

What went well?

What went less well?

Sunday Prep Work

danielhalasz commented 2 years ago
  • Logically I'm not strong. Many times I stuck with logic.

well that's ok, and that is why we are here, to learn and practice and practice some more :)

Dnyandeo33 commented 2 years ago

Week 3

I Need Help With:

What went well?

What went less well?

Everything went well but I'm struggling with these test errors.


FAIL src/utils/average.spec.js
  ● average: calculates the average of an array of numbers β€Ί averaging numbers β€Ί returns 0 for an empty array
    expect(received).toEqual(expected) // deep equality
    Expected: 0
    Received: NaN
       5 |     it('returns 0 for an empty array', () => {
       6 |       const actual = average([]);
    >  7 |       expect(actual).toEqual(0);
         |                      ^
       8 |     });
       [9](https://github.com/lab-brussels-1/Group-2-numbers-project/runs/6918331357?check_suite_focus=true#step:5:10) |     it('can average a single number', () => {
      [10](https://github.com/lab-brussels-1/Group-2-numbers-project/runs/6918331357?check_suite_focus=true#step:5:11) |       const actual = average([4]);
      at Object.<anonymous> (src/utils/average.spec.js:7:[22](https://github.com/lab-brussels-1/Group-2-numbers-project/runs/6918331357?check_suite_focus=true#step:5:23))``` 

## Sunday Prep Work
- Continue practicing 
danielhalasz commented 2 years ago

Everything went well but I'm struggling with these test errors.

do you have a link to the repo/branch/file? I will investigate

danielhalasz commented 2 years ago

try this

export const average = (nums = []) => {
  let averageNum = 0;
  for (const num of nums) {
    averageNum += num / nums.length;
  }
  return averageNum;
};
Dnyandeo33 commented 2 years ago

@danielhalasz Thank you so much It's work.