{"id":24770335,"url":"https://github.com/farhaj499/assignment2","last_synced_at":"2025-03-23T19:41:37.877Z","repository":{"id":215926223,"uuid":"740059219","full_name":"Farhaj499/Assignment2","owner":"Farhaj499","description":"Assignment 2:  Callbacks, Promises and Async Functions.","archived":false,"fork":false,"pushed_at":"2024-01-07T12:12:55.000Z","size":2659,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T03:38:05.333Z","etag":null,"topics":["async-await","callback-functions","promises","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Farhaj499.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-07T12:04:20.000Z","updated_at":"2024-01-07T12:14:15.000Z","dependencies_parsed_at":"2024-01-07T13:24:02.307Z","dependency_job_id":"3d98c48f-0f91-4c09-a83b-871c608fe1a9","html_url":"https://github.com/Farhaj499/Assignment2","commit_stats":null,"previous_names":["farhaj499/assignment2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Farhaj499%2FAssignment2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Farhaj499%2FAssignment2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Farhaj499%2FAssignment2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Farhaj499%2FAssignment2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Farhaj499","download_url":"https://codeload.github.com/Farhaj499/Assignment2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245161998,"owners_count":20570690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-await","callback-functions","promises","typescript"],"created_at":"2025-01-29T03:37:31.043Z","updated_at":"2025-03-23T19:41:37.817Z","avatar_url":"https://github.com/Farhaj499.png","language":"TypeScript","readme":"# Assignment Callback, Promise, Async and Await\n\n### **Question 1: Callbacks**\n\n**Task:**\nYou are creating a basic calculator application. Write a TypeScript function named **`calculate`** that takes two numbers and an operation (add, subtract, multiply, or divide) as parameters. Implement a callback function to handle the calculation and display the result.\n\n### **Question 2: Promises**\n\n**Task:**\nImagine you are building a simple quiz app. Create a TypeScript function named **`fetchQuestion`** that returns a promise. This promise should resolve with a random quiz question (string). Use the promise to display the question when it's ready.\n\n### **Question 3: Async/Await**\n\n**Task:**\nBuild a TypeScript function named **`waitAndGreet`** that takes a name (string) as a parameter. This function should use async/await to simulate a delay (e.g., 2 seconds) and then display a greeting with the provided name. Call this function from within an async function and log the result.\n\nThese tasks should be suitable for beginners while still covering the basics of callbacks, promises, and async/await in TypeScript.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarhaj499%2Fassignment2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarhaj499%2Fassignment2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarhaj499%2Fassignment2/lists"}