Skip to main content

Posts

Showing posts from September, 2015

Tool: Duck Piano

Hello. I've made a one-octave piano with duck (and chicken) sounds. A UI snapshot of Duck Piano : A demonstration: It is "FrÃĻre Jacques". I wore a Bluetooth headset while playing each tool. So there was some millisecond-delay each time I hit a note. From each tool itself plus the headset connection. Well. It is supposed to be FrÃĻre Jacques. In C major scale. Dormez-vous? Dormez-vous, mate? Duck Piano Accompanied by Oneveno H5

JavaScript: Checking Undefined Variable

This already has an answer on Stack Overflow. It's using typeof operator. As such: if (typeof yourVariable === "undefined") { // Do fallback method. } else { // Do your default method. } Chrome Developer Console Snapshot In this test, there's an undeclared variable called rey . The Other Method On JSLint , that method above will thrown an error message. This message: Unexpected 'typeof'. Use '===' to compare directly with undefined . To fix that, simply declare the uninitialised variable with var (or let ). Then compare that variable directly with undefined using triple equal ( === ). Like so: var yourVariable; if (yourVariable === undefined) { // Do fallback method } else { // Do your default method } Snapshot from Chrome console: 👋
Monkey Raptor uses cookies for analytics, advertisements, and functionality. Privacy Policy