Assessment wanted for Events Skills test by Dinesh

Hello there :wave:,
I have just finished Events skills tests, and I need a review for my codes. Here are my code pen links and task links.
Events 1 & Task link
Events 2 & Task link
Events 3 & Task link.

Thank you in Advance,
Dinesh.

Hi @Dinesh_Sake

Well done! :clap:

  • Task 1: :white_check_mark: Correct.
    • Since the event handler is only attached to the button, we can simply use btn.textContent instead of e.target.textContent.
    • The button also has a class of β€œoff”. It seems useful to also change this class with btn.className.
  • Task 2: :white_check_mark: Correct.
    • Maybe a switch statement would be easier than if...else...if.
    • drawCircle(x, y, size); can be written once at the end of the event listener instead in every condition.
  • Task 3: :white_check_mark: Correct.
    • Instead of e.currentTarget. just buttonBar. would also work.

As you see everything works correctly. My comments are just a few simplifications.

Happy coding,
Michael

1 Like

Have simplified the tasks according to your comments. Thank you for your valuable inputs.

1 Like

You’re welcome! :slightly_smiling_face:
Looks great now.