This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const url = require('url'); | |
const server = http.createServer(); | |
let messages = [ | |
{ 'id': 1, 'user': 'Cardi B', 'message': 'I got money!'}, | |
{ 'id': 2, 'user': 'the Munchkins', 'message': 'ding dong the witch is dead'}, | |
{ 'id': 3, 'user': 'bart simpson', 'message': 'don\'t have a cow, man'} | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isOverTen = (num) => { | |
return new Promise((resolve, reject) => { | |
if (num > 10) { | |
resolve(num + ' is greater than 10') | |
} else reject(num + ' is less than or equal to ten') | |
}); | |
} | |
const makeCaps = (arr) => { | |
return new Promise((resolve, reject) => { |
OlderNewer