neerajrathore / javascript-handbook

A handbook 📚 that summaries concepts of JavaScript.
https://javascript-handbook.vercel.app
MIT License
25 stars 39 forks source link

[Hacktoberfest '24]: Added JS callback (Issue: #68) #71

Closed sujanrupu closed 1 month ago

sujanrupu commented 1 month ago

Added JS Callback, Issue: #68

This PR introduces an example demonstrating the use of async/await in JavaScript for handling asynchronous API requests. The implementation includes:

HTML: Basic structure with a button to trigger data fetch and a section to display results. CSS: Simple styling for layout and button aesthetics. JavaScript: Fetches data from an API using async/await, displays the result in the DOM, and handles potential errors. This example improves readability and maintainability compared to traditional callback-based methods.

image

sujanrupu commented 1 month ago

@neerajrathore please review the PR, updated accordingly