Skip to content

Instantly share code, notes, and snippets.

View garyb1's full-sized avatar

Gary Byrne garyb1

View GitHub Profile
@garyb1
garyb1 / arrayDiff.js
Created November 30, 2020 08:02
arrayDiff interview question from the Cassidy Williams (cassidoo) newsletter
//Given an array of integers and a target value
//return the number of pairs of array elements
//that have a difference equal to the target value
//arrayDiff([1, 2, 3, 4], 1);
//Result = 3.
// 2 =1 = 1, 3 -2 = 1, 4 -3 = 1;
function arrayDiff(arr, target) {
return arr.reduce((accumulator, currentValue, currentIndex) => {
@garyb1
garyb1 / README.md
Last active April 21, 2020 20:48
Piccalilli - Frontend Coding Challenge 001 - Using FontFaceObserver

Using FontFaceObserver

Picalilli.li coding challenge solution by Andy Bell can be found here

The following code is my attempt with an alternative font loading approach using fontFaceObserver by Bram Stein.

According to Bram

"If you’re loading fonts this way your visitors will experience FOUT