Tag: beginner tips
-
I made a thing: Aroha generator
So I made another thing. The only reason I’m really even talking about it is because what’s going on in Christchurch is so awful I can hardly bear it. Making new things (even simple things like this) is a good distraction. So in an effort to cheer myself up I made a web thing that…
-
Constantly letting down my variables
As it turns out I’ve been doing everything wrong. Well, maybe not everything, but at the very least I’ve been declaring variables incorrectly. There are actually three different variable types in JavaScript, var, let, and const. I’ve been using var exclusively and it’s actually bad practice. So what’s the difference between each and which should…
-
How to write modern JS
So you’re learning JavaScript (JS), cool. Putting all this effort in, you’ll want to be learning the modern usage of the language right? Time to get strict. “use strict” is something I recently stumbled across, and it seems like a really important thing to be using. So much so that I’m a bit surprised it…
-
Pastebot
The more time I spend coding the more time I find myself researching solutions to workflow problems I’ve never had before. Copy and paste is a good example of this. Sharpening my coding skills I find myself copying and pasting a lot more than normal. Maybe a better way to say it is coping and…
-
on() click()
Today I learned the difference between the on(“click”) and click() methods in jQuery. click() only adds listeners for existing elements, so it will completely ignore any dynamically added items. So, in the example below only the <li> declared in the HTML file will be clickable. All of the new <li> elements added to the to-do…
-
Pigs in namespaaaace
When you’re working on a JavaScript (JS) app you’ll create loads of functions and variables. By default in JS, there is no namespacing so everything you declare is effectively in the global namespace. This can lead to issues where two or more functions or variables can easily be called the same thing and create conflicts.…
-
Atom snippets
One of the things I love about modern text editors is code snippets. Coding tends to involve repetition, code snippets can really help cut down on needless typing. I group all my code snippets by prefixing them with “my”. That way to view all my snippets I just start typing “my” and Atom shows all…
-
Selection
One thing I notice about jQuery is how it simplifies common tasks. A good example is something you do all the time with JavaScript, select DOM elements. In JavaScript selecting all li elements would look something like this: The same selection using jQuery is like this: At this stage of my learning, I can’t say…
-
Emmet!
Whatever your text editor of choice (I just can’t quit you Atom) there is a wide range of plugins to enhance its capabilities. One such plugin that I use constantly is Emmet. Emmet can be used for a number of things, but where it really shines is speeding up my HTML production. Emmet uses a…