Assessment Wanted for All Functions

Hi, I need an assessment on the below function(s), I really enjoyed this function. much interesting than array lol :joy:

Here is the task link:

Your feedback will be highly appreciated. Thanks in advance😎

1 Like

hello @Olixpin

you doing great well done just some notice here :

  1. for task 2
    ctx.width = width; and ctx.height = height; will set the width and height of the convas which already set by the html code part
<canvas width="480" height="320">

but this will not even work why ? cause it called by

ctx.canvas.width = width;
  ctx.canvas.height = height;

or

  ctx.canvas.style.height = height;

but in both cases it not needed cause we want to draw inside the canvas (part of the canvas)

also using clearRect could get some issue as mentioned in the note on link

so the easier way to fill the whole canvas with white (background color) then do your code

by the way you set the property before draw it so you need to set the color before calling the strockRect function

  1. the first part of the third function should be generic so you give it the lower and upper bound and it select random number from lower to upper
    i know array will be always has lower as 0
    after that you would need to change how you call it :wink:

i notice also you like the arrow function :wink:

hope that help and have a nice day :slight_smile:

2 Likes

Thank you so much for the feedback but I must say, the function 2 exercise seems not clear enough for me. But I have made corrections to it. You can check the link again.

Lastly, for the ‘function 3’, what exactly is wrong with the code?

you very welcome well done for function 2 what is not clear about it?

for function 3

the task ask for
Refactor the code that generates the random number into a separate function called random(), which takes as parameters two generic bounds that the random number should be between, and returns the result.

that mean this function should take 2 parameters (numbers) and return a random value between those 2 parameters but your method has only one parameter which is the array itself

and have a nice day :slight_smile:

2 Likes

The function 2 has been updated. Kindly check, please.

Would update function 3 as well.
Thank you for the feedback.

1 Like

elslamo alikom @Olixpin

i already did that why i said well done :wink:
i just asked what is not clear about it as you said before

so i was asking so i try to explain what confuse you :wink:

take your time and happy coding :slight_smile:

i forget to mention that your email is shown next to your name so try to go to the setting and hide it if you like :slight_smile:

1 Like

Thank you so much for the feedback. I have never seen a community like this.

Oops, I can’t imagine my mail is visible for everyone. That’s crazy :tired_face:
Thank you for letting me know. Updating that as well.

1 Like

you very welcome @Olixpin and glad to see that you enjoying the mdn world and i totally agree that a lot of great people same as you :slight_smile:

that why the first thing i do when i create or register to any service i run for the setting page :wink:

i think @mikoMK contact the admin or maybe one of the team but not sure if he got replay about they change that behavior or not

you very welcome and welcome again to the mdn :partying_face:

and have a nice day both of you :slight_smile:

1 Like

Another user opened an issue on GitHub, but nothing happened until now :slightly_frowning_face:

1 Like

thanks for the info boss @mikoMK :wink: time to hunt one of the team in mdn :joy:

1 Like

i created another post there

and tried to tag someone from the team hope they did not shoot me in the face :joy:

1 Like