Skip to content

Instantly share code, notes, and snippets.

View StanleyMasinde's full-sized avatar
🎯
Focusing

Stanley Masinde StanleyMasinde

🎯
Focusing
View GitHub Profile
@StanleyMasinde
StanleyMasinde / promises.js
Created October 28, 2023 13:22
A simple test on Promise.all()
// Promises without dates
(async function main() {
const promise1 = new Promise((resolve, reject) => {
setTimeout(() => {
resolve('Promise 1')
}, 5000)
})
const promise2 = new Promise((resolve, reject) => {
setTimeout(() => {
@StanleyMasinde
StanleyMasinde / xmlhttp.js
Created January 19, 2024 15:48
XMLHTTP Request
const req = new XMLHttpRequest()
req.addEventListener('load', (event) => {
console.log(event.target.response)
})
req.open('https://jsonplaceholder.typicode.com/posts')
req.send()