I just went through a JS exercise and even though I did pretty well in terms of getting the logic right, I always have a hard time with the syntax, especially once you start combining things. Console.logging the result of calling a function without passing parameters? Where the hell do I put brackets? Using an … Continue reading JavaScript Syntax Death Match Part I – Variables, If/Else, Switch & Functions
Category: JavaScript
Shortening Sh*t in JavaScript – A Cheat Sheet
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
How JavaScript Functions work for Dummies like me
What are functions and why do we need them anyways? Functions are used to tell the machine to do a certain action, or sequence of actions. When you call the function in the code, it'll do what you told it to do in the function. Think of the function like training a dog to do … Continue reading How JavaScript Functions work for Dummies like me
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?
