Skip to content

AditiMishra02/JavaScript-code-examples

Repository files navigation

JavaScript Code Examples

This repository contains a collection of JavaScript code examples covering various concepts and use cases.

Table of Contents

  1. Simple Calculator
  2. Todo List with Local Storage
  3. Basic Weather App using Fetch API
  4. Simple Quiz Game
  5. Basic Timer using setTimeout
  6. Simple HTTP Server using Node.js
  7. Basic Promise Example
  8. Simple File System Operations using fs Module
  9. Simple EventEmitter Example

Simple Calculator

File: calculator.js

Description: This JavaScript file contains functions to perform basic arithmetic operations such as addition, subtraction, multiplication, and division.

Todo List with Local Storage

File: todo.js

Description: This JavaScript file demonstrates how to create a simple todo list application using local storage for storing todo items.

Basic Weather App using Fetch API

File: weather.js

Description: This JavaScript file fetches weather data for a specific city using the Fetch API and displays the weather description.

Simple Quiz Game

File: quiz.js

Description: This JavaScript file implements a basic quiz game where the user is prompted with questions and can input answers.

Basic Timer using setTimeout

File: timer.js

Description: This JavaScript file implements a basic timer using the setTimeout function to display a countdown.

Simple HTTP Server using Node.js

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.

Basic Promise Example

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.

Simple File System Operations using fs Module

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.

Simple EventEmitter Example

File: event_emitter.js

Description: This JavaScript file demonstrates how to create and use a simple EventEmitter in Node.js to handle custom events.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published