I must admit, JavaScript syntax isn't the easiest thing I've encountered. It's not so much the 'words' but the symbols that I have a hard time remembering. Normal brackets, swirly brackets, or no brackets? Single, double or no quotation marks? Ergh! Additionally, there a multiple ways of writing the same thing. I know this was … Continue reading Shortening Sh*t in JavaScript – A Cheat Sheet
Tag: code
What is Math.random and Math.floor good for?
Sometimes you want your code to spit out random numbers, because who doesn't like a random number right? (Looking at you lottery lady) Math.random ( ) ; Returns a random number between 0 and 1 (excluded). You can then multiply it by 10, for example, to get a number between 0-10, or by 1000 for … Continue reading What is Math.random and Math.floor good for?
Who or what is a Boolean?
A Boolean only has two possible values: true or false. That's it. It's like a yes or no question, or an on or off switch. Why does it have such a funky name? Boolean logic, the holy binary 0 or 1 thing that computing is based on, is named after its inventor George Boole. Often … Continue reading Who or what is a Boolean?
