Blog

Archive for the JavaScript Category


JavaScript to Determine If on Apple Device (works on IE 10 and above)
Posted on July 23, 2020 in Apple, JavaScript by Matt Jennings

(function() {
// Detect if Apple device – see:
// https://stackoverflow.com/questions/19877924/what-is-the-list-of-possible-values-for-navigator-platform-as-of-today

// Polyfill for
Read more…


Remove Duplicates from Array in JavaScript
Posted on July 24, 2019 in Algorithms, JavaScript by Matt Jennings

function removeDuplicates(arr) {
var arrNoDupes = [];

// Iterate through array passed in by parameter

Read more…


Prime Number Checker in JavaScript
Posted on June 19, 2019 in Algorithms, JavaScript by Matt Jennings

In JavaScript, Write a Function that Returns true or false if a Number is Prime

function checkPrime(num) {
var primeCheckerArr =
Read more…


Find Unique Characters in a String
Posted on June 19, 2019 in Algorithms, JavaScript by Matt Jennings

Find the First Non-repeating Character in a String

var string = ‘what a wonderful day it has been!’;

function firstNonRepeatedChar(str) {

Read more…


Joys of JavaScript (UW Coding Bootcamp Session)
Posted on June 1, 2019 in JavaScript by Matt Jennings

Primitive Variables

Types of primitive values:

Numbers
Strings
Booleans
undefined
null
Symbol() (ES6)

confirm vs prompt

// confirm only returns a Boolean of true or false
// depending on if
Read more…

To Top ↑