Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function simonSays(speech: string, callback: Function) {
- callback(undefined, speech);
- }
- function promisedSimonSays(speech: string): Promise<string> {
- return new Promise((resolve, reject) => {
- simonSays(speech, (err: any, result: any) => {
- if (err) {
- reject(err);
- } else {
- resolve(result);
- }
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement