Articles on JavaScript

Ken Shimizu

Ken Shimizu

Sharing and Testing Code in React with Higher Order Components

Higher Order Components (HoC) in React can be simple to use and test. If you haven’t read about HoC’s and how and why they’ve replaced mixins, check out this great Medium post by Dan Abramov. Most of the resources and examples that I found online about higher order components are complex, and don’t include a

Rudy Jahchan

Rudy Jahchan

Getting Started in Virtual Reality with JavaScript [Video]; Announcing Android Workshop

Virtual Reality is something we at Carbon Five have been playing around with the past few months, learning not only how to get started but how we can use our current toolset to work within the growing field. That’s why I was excited two weeks ago to give a talk on getting started in virtual

Erin Swenson-Healey

Erin Swenson-Healey

Composing Synchronous and Asynchronous Functions in JavaScript

Our example application implements a function createEmployee that is used to create an employee from a personId. To create an employee, our system loads some data from our database, validates that data, and then performs an insert. Some of our functions are written in continuation-passing style (they accept a callback) and some are written in

Erin Swenson-Healey

Erin Swenson-Healey

Gettin’ Freaky Functional w/Curried JavaScript

Partial application refers to the practice of filling in a functions parameters with arguments, deferring others to be provided at a later time. JavaScript libraries like Underscore facilitate partial function application – but the API isn’t for everyone. I, for one, feel icky sprinkling calls to _.partial and _.bind throughout my application. Curried functions (found

Erin Swenson-Healey

Erin Swenson-Healey

Tidying Up a JavaScript Application with Higher-Order Functions

Higher-order functions are functions that can do one or both of the following: Take a function or functions as arguments Return a function as an argument Most programmers by now are familiar with higher-order functions such as map, reduce, and filter. These functions abstract away the boilerplate when processing collections. For example… Given a string-capitalizing

Painting colors
Thomas Fisher

Thomas Fisher

WebRTC Made Simple

WebRTC is a set of JavaScript APIs that enable peer-to-peer, realtime communication between web browsers. It offers some pretty amazing capabilities, but getting through even a basic introduction to it can be daunting. The variety of new APIs and protocols is a lot to digest. This post is a simple guide to getting up-and-running with

Thomas Fisher

Thomas Fisher

Building a Real-time Scoring System for the NPGL

This Tuesday in Madison Square Garden, the National Pro Grid League will have its first regular season match. Three months ago, we started building the real-time scoring system that backs its events. Here’s how we did it: Madison Square Garden

Thomas Fisher

Thomas Fisher

AngularJS Scopes: An Introduction

[raw] At Carbon Five, we build quite a few AngularJS projects. It’s a fun, powerful framework that gets you up and running quickly, but once you’ve got your feet wet, you run into its infamous learning curve. AngularJS has a fair share of deep concepts; taking some time to understand them can get you back

Jeremy Morony

Jeremy Morony

A Strategy for Loading Page Specific JavaScript

Since the introduction of the asset pipeline, managing javascript assets in a typical rails application is pretty straight forward. You figure out some structure for organizing the files under app/assets/javascripts/, concatenate them together with some directives in application.js, and that file is most likely included in a layout and you’re on your way. But what

Rudy Jahchan

Rudy Jahchan

Sweeter Javascript: Defining Properties to Add Syntactic Sugar

Syntatic sugar makes for more human-readable code and, if done correctly, provides for more flexibility. In the world of Node many turn to Coffeescript to add that “sweetness”, but you can also achieve it with plain old Javascript.