Tag: code

  • How to write modern JS

    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…

  • I made a thing: To-do list

    I made a thing: To-do list

    Yep, I made another thing in JavaScript for the course I’m doing. This one’s a bit more basic, but really it’s more of cutting my teeth with jQuery sort of project rather than something anyone would actually use. It’s a very simple todo list app that lets you add and remove items from a simple…

  • on() click()

    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…

  • What is the state of JavaScript?

    What is the state of JavaScript?

    This JavaScript thing is really catching on eh? As the name suggests, “the state of JavaScript” survey gives a snapshot view of JavaScript development. What everyone (over 20,000 developers anyway) is using and enjoying or otherwise. It also gives a general sense of the direction things are going in. As with the StackOverflow survey, I found…

  • Pigs in namespaaaace

    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

    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

    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…

  • Survey says

    Survey says

    Today I was reading the 2018 stack overflow developer survey and boy was it an interesting read. There are loads of insights into the current state of software development. For example, JavaScript continues to grow in dominance. If you’re working on the web and you’re not learning JavaScript you need to start yesterday. It’s been…

  • Emmet!

    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…