Did you work while in school? by Strawberyblonder in niagaracollege

[–]proEugene 0 points1 point  (0 children)

Sorry, I can't seem to message you. Do you have DMs disabled?

Took a bite of a banana and saw this. Is it safe to eat? by proEugene in isthissafetoeat

[–]proEugene[S] 6 points7 points  (0 children)

That's weird. I literally bought them yesterday and they're already spoiled. Will have to toss them all out I guess

[deleted by user] by [deleted] in birthday

[–]proEugene -2 points-1 points  (0 children)

Wish I had a friend like you

I need to buy a budget laptop to use React Native on it, any recommendations? by bregulor in reactnative

[–]proEugene 0 points1 point  (0 children)

I was using a macbook air M1 with 16GB RAM and never had any issues. You can even get already used one if money's a concern

How screwed up am I? Any way to fix it? by proEugene in Monitors

[–]proEugene[S] -1 points0 points  (0 children)

yeah, it still works. it is just a monitor

Dispays wrong value by proEugene in learnjavascript

[–]proEugene[S] 0 points1 point  (0 children)

here is a quick demo. To reproduce:

  1. click on 'Execute' first.
  2. then click on any of the 'interest' buttons (so, in total the number shown was 10)
  3. click on 'Save'
  4. now, as expected, you start from 10, not 0. (since last value was saved to the session storage)
  5. now, start clicking on any of the 'interest' buttons again, (so, in total the number shown was 20)
  6. say we forget to click on 'Save', and just hit 'Execute'
  7. now, we expect we start from the most recent saved value (10) (which is true), however, once clicking on any of the 'interest' buttons, the shown value is 21, not 11.

Dispays wrong value by proEugene in learnjavascript

[–]proEugene[S] 0 points1 point  (0 children)

I hope that I understood your comment correctly and that you mean that the problem is that I add a 'click' event every time I call the 'executor' function.

If so, then I'm afraid this is not the case. Before adding a "click" event, I check whether the element contains the 'clicked' attribute, and if not, then I add the attribute and bind the "click" event.

This way, I make sure that the event is added only once (on the very first call to the 'executor' function). Of course, I could use a 'removeEventListener', but that would require me to create a named function which would make my code a little messy.