Coding task · JavaScript and TypeScript course · Module 4: Asynchronous JavaScript

Practice: Creating a Promise

Create a Promise that simulates checking the dinosaur enclosure status. Use new Promise((resolve, reject) => {}) with setTimeout to simulate a delay.

Task

Create a Promise that resolves after a delay with dinosaur status data, or rejects if the sensor is not responding.