Skip to content

Conversation

@Alaa2019-ml
Copy link

No description provided.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Textbook solution, well done :)


// TODO add your JavaScript code here.
const ul = document.querySelector('ul').children;
ul[0].textContent = 'Alooy';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like this solution 100% .. because if the li tags in the html code would get changed (hypothetically, by say a colleague, at some later point) -- then the words would now appear in the wrong place!

Luckily, there's away to prevent this, by using the classnames (.nickname, .fav-food, hometown) to target the right li elements you want to put the words in.

Can you change this to target the li elements using their classes?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid to say I can't really check this exercise, because Google as it shows up on my computer doesn't show an img, but an svg, and also has a different alt. That being said, I'm sure your solution would not work, because the URL images.png .. would reference https://google.com/images.png, which surely doesn't exist. What's the deal here?

const minutes = String(time.getMinutes()).padStart(2, '0');
const seconds = String(time.getSeconds()).padStart(2, '0');
span.textContent = `${hours}:${minutes}:${seconds}`;
div.appendChild(span);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's a bit strange about this solution, is that every time you update the time (every second), you also add the span to the div, and the div to the body. This in weird/incorrect/wrong. It doesn't lead to any problems though, because the DOM understands that the same element can't be added twice to the same parent, so it just skips it. But I'd rather see you only do it once, anyway, to show that you understand what you're doing :) Maybe you can fix this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your solutions does seem to do something, but the cate moves at an incredibly slow pace, and it just seems like you might not have been crafting this solution yourself in a constructive way, and rather relying on prediction and/or AI.

I'd like to point out that for a development workflow, you need to at least follow these steps:

  1. Make sure you open the devtools console and take note of any errors that occur, so you get early feedback on possible problems in your code.
  2. Make small incremental steps towards a solution, while observing that your edits make actual changes in how your solution is working. It feels like you just put all the code in, without getting any feedback from your solution.
  3. Use tools like console.log(...) to figure out what's going on during the execution of your code, it you don't understand it. This can be extremely useful!

Please try to redo this exercise, following this process.

Note that this is the hardest exercise of the bunch, so it's totally understandable if you're having trouble with it :) I If you can't get any further with this exercise, it might be wise to schedule a little call (possibly shared with others) to discuss how to approach this kind of exercise. Let me know :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do it, but I’m not sure. I think I have a problem with getting the middle of the screen and resuming the function. I would appreciate it if we could schedule a call to go through it thoroughly.

Copy link
Author

@Alaa2019-ml Alaa2019-ml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Kelley,
Can you please check my code and approve it if it looks good?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants