JavaScript Adding Event Listeners to Dynamic Content with Event Delegation Have you ever added a button to a page with JavaScript expecting it to function fully, but when you clicked it nothing happened? You've double checked your code - you're creating the event
JavaScript JavaScript Closures, and How They Work Closures, as well as being a favourite interview question, are one of the more confusing parts of JavaScript.Despite the wealth of articles offering explanations of closures, there are dozens of threads on
General How to write comments to improve code clarity I'm not going to lie - I used to struggle writing comments. I have wasted hours writing comments that aren't helpful to anyone, while leaving out comments that have cost me hours of
JavaScript Function Declarations vs Expressions: A Quick Guide Here's the question: What's the difference between these two methods of creating a function?function a() { //This is known as a function declaration console.log("Hello"); } var b = function() { //This is known as
General Bad code isn't shameful Let's be honest. We all write bad code.Sometimes, we write absolutely shocking code.In the programming community, we have an obsession with "good" code – and it's not difficult to see why. Good
CSS How to keep your Flexbox square If you're transitioning from absolute layouts into flex-box, you end up with this annoying situation where you want to keep something square (or at least at a 1:1 ratio). Flex-box is supremely
JavaScript Creating Timed Sequences in Javascript When you start working in Javascript and building apps and webpages, you get used to running code based on inputs - someone pressed a button, and then your code gets to run.This
JavaScript How to structure your JavaScript for Readability When we learn to write code, we spend a lot of our time doing exactly that - writing code. As we transition into careers and larger projects however, we find out that we
JavaScript Writing useful unit tests Let's face it, writing unit tests is hard.Many new coders take a long time to get into unit testing. They're scary, a lot of effort, and it's difficult to understand how they
CSS 6 Tips for making a responsive website from scratch When you're starting out with CSS and the web, it's easy to get into frameworks like Bootstrap, or Bulma. They're an excellent tool for fast prototyping, and getting to grips with how to
JavaScript Introduction to Readable Javascript Readable code is something everyone seems to want, but nobody seems to teach. This article distills advice about readable code into a series of guidelines to build on as you grow.