-
Notifications
You must be signed in to change notification settings - Fork 7
Alaa nasher w1 browsers #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Alaa nasher w1 browsers #22
Conversation
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
- 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.
- 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.
- 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 :)
There was a problem hiding this comment.
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.
Alaa2019-ml
left a comment
There was a problem hiding this 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?
No description provided.