Help and Assessment wanted for Functions 4, 3, 2, 1 - vlad

Hey There!

I used one file for all of my Functions Assessments, they’re just commented out. Pardon any confusion. I just want to be efficient with the space.

I noticed that para.textContent = shortNames; outputs Anne,Tina,Bert,Jada. I’ve been trying to figure out how to add a space between the commas so the output is Anne, Tina, Bert, Jada.

What’s the best way to do this? I tried some different methods but no luck.

Live site: https://javascript-functions-assessment.glitch.me

Code: https://glitch.com/edit/#!/javascript-functions-assessment

I know it could be confusing but I’d also appreciate an assessment if possible! :slight_smile:

Cheers,
Vlad

Hello @Vladlen_Vronsky

Well done! :+1:
Here are my comments:
Task 1: :white_check_mark: Correct.
Task 2: :warning: Mostly correct. You don’t need ctx.fill();. The previous line already creates and fills the rectangle. Also I would generally clear the canvas before starting to paint: ctx.clearRect(0, 0, canvas.width, canvas.height);. (No difference in this particular exercise)
Task 3: :white_check_mark: Correct.
Task 4: :white_check_mark: Correct.

Instead of the implicit toString() method you could use join() where you are able to define a separator: para.textContent = shortNames.join(', ');

See you,
Michael

1 Like

This was a huge help!!! Thank you for all your mentorship, good sir @mikoMK

1 Like

Understood! Thank you! I’ll review + fix this.

1 Like