When it comes to JavaScript interviews, employers are looking for practical knowledge as much as theoretical. So, here’s a list of 20 core JavaScri...
For further actions, you may consider blocking this person and/or reporting abuse
I found Debouncing & Throttling a bit complicated for me. Is it even used in real world application or not ?
Also, I found closures interesting concept.
@john12 ,
Yes, debouncing and throttling are widely used in real-world applications, especially in front-end development where performance optimization is key.
1. Debouncing
2. Throttling
Together, these techniques prevent “overcalling” functions, which can lead to performance issues, especially on mobile devices or slower networks.
Also,
Closures are indeed fascinating! They allow functions to retain access to their original scope, even after that scope has finished executing.
Let me know if you’d like more examples or a breakdown of any particular concept in order to unserstand it better!
Wow nice and detailed explanation
Thanks @hraifi
wow, you have just published another blog in the comments. Is it for real or it's GPT generated.
Well it's well explained , now I understand the whole concept of Debouncing and Throttling
Thank you! Also, this response isn't generated by GPT. I personally invested time in crafting it to ensure that users can gain a better understanding of the concept.
Thank you for the efforts !!
AI much? 🙄
Thanks @john12
That's a perfect analogy for explaining JavaScript Promises!
Here's how it breaks down:
Pending: Just like waiting for your pizza, a Promise starts in a pending state. You don’t have the result yet; it’s just a promise that something will happen, similar to how platforms like Mobcup queue content for processing.
Fulfilled: If everything goes smoothly — the pizza arrives on time — you receive what you ordered, and the Promise is fulfilled. In JavaScript, this means the Promise returns the expected result.
Rejected: Sometimes things go wrong, like a broken oven at the pizza shop. If the promise can’t be kept, it moves to a rejected state, returning an error.
Using this story, with Mobcup as a reference, makes it easy to remember: a Promise is just JavaScript’s way of saying, "I'll try to get this to you, but I’ll let you know if there’s an issue along the way."
Thanks for sharing detailed explanation.
I didn't understand the concept of Promises ??
okay let me explain this with a short story,
Imagine you order a pizza. The pizza shop promises it’ll arrive soon. Right now, your order is pending. After some time, either:
In JavaScript, a Promise works the same way! It’s like saying, “I promise to do something later,” and based on what happens, you either get a result (fulfilled) or an error (rejected).
Thanks for this nice explanation with story.
Wow !!
That look's promising !!
Unfortunately, this is not correct.
Misconceptions About Closures
Jon Randy 🎖️ ・ Sep 27 '23
Thanks for sharing and clearing misconception @jonrandy
Thanks for the effort! I’d like to share that EchoAPI is perfect for testing JavaScript APIs, making it easy to manage requests and responses seamlessly.
Thanks for suggestion @philip_zhang_854092d88473
Great overview of key JavaScript concepts! 🚀 The examples make things easy to understand, especially closures and hoisting. Thanks for sharing this! 🙌
You're very welcome! 😊 I'm thrilled to hear that.
Very 👍
Async await and promises difference and similarity is asked in my previous interview.Aslo currying is important question.
All the important aspects are covered in this blog.