I've been working with JavaScript for a while now, and every time I think I've got a solid grasp, some tricky concept like `this`, `null`, or certain async behaviors throw me off. I'm curious if others face this too—what JavaScript concepts do you still find puzzling or have to double-check regularly?
5 Answers
Working with promises tends to confuse me, especially when it goes beyond a simple resolve. I'll get the concept, but the syntax feels tricky every time! It’s like, I need to think extra hard about it, and that’s not a great feeling.
Right? I can relate. Async stuff in general gives me a headache.
I frequently mess up words while typing, like accidentally writing 'funciton' instead of 'function', and it gets stuck in my head for a whole week with that song playing on repeat! It's frustrating but also a hilarious moment when it happens.
You must be joking! Now I've got that tune in my head too. May your next bug be a headache—good luck!
Substring and substr have me puzzled too! Substr is deprecated now, so it's best to stick with substring. I remember when they first introduced it, and I kept mixing up which to use, leading to hours of frustration trying to debug!
Glad I'm not alone in this! Slice has become my go-to method.
Yeah, just forget about `substr`! And don’t even get me started on how slice works differently.
You know, it’s usually the small things that trip me up, like remembering whether to use `includes()` or `contains()`, and when an object supports `map()`. Also, I'm always mixing up `target` and `currentTarget` and sometimes can’t remember the difference between `innerText` and `textContents` when working with DOM elements.
Right? It's a constant struggle deciding whether to use `some` or `any`. For a sec, I wasn't even sure how to explain the difference just now!
Using functions and getting `this` to behave correctly is still a challenge for me, especially in callbacks. I just can’t seem to wrap my head around the differences!
I get it! It seems like arrow functions should be less complicated, but they still trip me up.
Once you get it, it's pretty straightforward, but until then, it’s a maze!
I hear you, async/await has made things easier for me but I still find myself getting tangled up sometimes.