Closures exist, so what are they?

Closures exist, so what are they?

Closures are a style of writing JavaScript that provides object data privacy. What this seems to mean is that you can define a function within another function. Your child function will be able to access things from the parent function, but the parent function will not be able to access variables in the child function unless it explicitly calls the child function. The child function might also choose to return only a subset of data that it was provided. This is called partial application. ...

March 26, 2019 · 3 min · Nick Hayden
Change your life with CSS Variables

Change your life with CSS Variables

We all know and love using variables in our SASS files, it’s basically the most often used selling point for SASS and LESS and along with things like mixins and nesting it’s what I use the most out of all of those tools’ features. Using CSS Variables CSS Variables are super easy to use. If you’ve used a CSS preprocessor before you already know how they work and why we’d use them. I’ll give the rest of the audience a quick run through though. ...

May 7, 2017 · 6 min · Nick Hayden
Let’s talk about CSS Grid

Let’s talk about CSS Grid

Why CSS Grid caught my attention It seems like everywhere I’ve been lurking lately including the office has had people talk about CSS grid and what it means for developers and how we build websites. I sat down this week to really try and understand CSS grid, what it does and how it works. I’m a huge fan of Flexbox so I initially I didn’t care as much. I think now that I’m spending more time looking at it I think CSS grid coupled with Flexbox is going to be the way to go in the future and put us all out of a job, especially with AI and Machine Learning building websites for us. ...

April 10, 2017 · 9 min · Nick Hayden
WTF is strict mode?

WTF is strict mode?

You might have seen your colleagues dropping in ‘use strict’ into their JavaScript code and wondered: WTF does that do? Another place you’ll often see use strict in place is within libraries and shared code on somewhere like GitHub. Strict mode is an opt-in way for developers to follow a restricted set of JavaScript. One reason developers might use strict mode is because it allows for greater optimisation by the browser. Using strict mode means that the browser has to make less judgement calls about what is and is not possible this means that the browser can take short cuts when it comes to interpreting your code because it knows you’ve followed a stricter standard. ...

February 27, 2017 · 6 min · Nick Hayden
Understanding why we use `===` in JavaScript

Understanding why we use `===` in JavaScript

Often in JavaScript you’ll see a developer use === in their conditionals instead of ==. Most languages will use single equals for assignment and double equals for comparison, JavaScript is no exception here. This third variation of triple equals is included in JavaScript and sees to cause the most confusion for developers and it turns for a very good reason. Triple equals is most often included in loosely typed languages such as JavaScript and PHP. A language like Ruby also has triple equals but it is used in a different way. ...

February 20, 2017 · 3 min · Nick Hayden
Working with Google Custom Search (GCSE)

Working with Google Custom Search (GCSE)

Lately I’ve been working on a website that integrates Google Custom Search Engine (GCSE). I haven’t worked with GCSE before and found it somewhat difficult to work with. The API and creating the search is a really easy process and the Google team did a great job with sensible defaults. The main problem for our team was that we had already built a search component in our front-end build that looked like this: ...

February 9, 2017 · 4 min · Nick Hayden