This repository contains a collection of JavaScript code examples covering various concepts and use cases.
- Simple Calculator
- Todo List with Local Storage
- Basic Weather App using Fetch API
- Simple Quiz Game
- Basic Timer using setTimeout
- Simple HTTP Server using Node.js
- Basic Promise Example
- Simple File System Operations using fs Module
- Simple EventEmitter Example
File: calculator.js
Description: This JavaScript file contains functions to perform basic arithmetic operations such as addition, subtraction, multiplication, and division.
File: todo.js
Description: This JavaScript file demonstrates how to create a simple todo list application using local storage for storing todo items.
File: weather.js
Description: This JavaScript file fetches weather data for a specific city using the Fetch API and displays the weather description.
File: quiz.js
Description: This JavaScript file implements a basic quiz game where the user is prompted with questions and can input answers.
File: timer.js
Description: This JavaScript file implements a basic timer using the setTimeout function to display a countdown.
File: http_server.js
Description: This JavaScript file demonstrates how to create a simple HTTP server using Node.js, which responds with "Hello, World!" to all requests.
File: promise_example.js
Description: This JavaScript file demonstrates how to use promises to handle asynchronous operations. It defines an async function that resolves after a delay and logs the result.
File: file_system.js
Description: This JavaScript file demonstrates basic file system operations such as reading from and writing to a file using the fs module in Node.js.
File: event_emitter.js
Description: This JavaScript file demonstrates how to create and use a simple EventEmitter in Node.js to handle custom events.