Last active
November 12, 2019 19:30
-
-
Save tomhodgins/71bd6ae8bf1219448cba414891257163 to your computer and use it in GitHub Desktop.
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
window.console = { | |
original: console, | |
...console, | |
speak: (strings, func, start) => strings.forEach(string => { | |
speechSynthesis.speak(new SpeechSynthesisUtterance((start ? start : '') + string)) | |
return console.original[func](string) | |
}), | |
log: (...strings) => console.speak(strings, 'log', `Dear diary. `), | |
info: (...strings) => console.speak(strings, 'info', `For your information. `), | |
warn: (...strings) => console.speak(strings, 'warn', `I'm warning you. `), | |
error: (...strings) => console.speak(strings, 'error', `Red alert. `) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment