decorate your javascript
February 28, 2018Javascript decorators are a form of metaprogramming: they add functionality to classes and properties. Unlike the GoF pattern, where…
Javascript decorators are a form of metaprogramming: they add functionality to classes and properties. Unlike the GoF pattern, where…
Browser-sync is the fastest way to spin up a local web server. It will even open your default browser with the entry point you specify, and…
A service worker is a script that sits between a web page and the network, acting as a proxy for network requests: if the network is…
The EventEmitter pattern is a derivative of the Observer pattern: an object can notify a set of observers when a change in its state occurs…
When I started writing javascript in earnest a couple of years ago, I was stuck in a very procedural way of thinking — all of my functions…
JavaScript Objects are complex types, and even defined properties have a control panel of their own. You can view the content of the control…
If you have more than one javascript running on a page, you have likely experienced the hell of trying to debug a problem caused by naming…
Getters and setters make sense in java, and I just learned that there is an equivalent pattern in javascript: The and key words are…
Object-oriented programming (OOP) can be thought of as describing the properties and behaviour of a noun in a blueprint, which is used to…
I have encountered more than my share of javascript errors because I have made assumptions about the object I am working with, such as…
Troubleshooting a d3 data visualization sometimes requires visual inspection of the underlying JSON data structure. You can convert linear…
Javascript Date objects have zero indexed months but not dates. Wat? Resources Javascript strftime
Almost every day, javascript blows my mind. Today I discovered that you can convert a string to a number simply by prepending a +: Awesome.
The statement can function as a quick and semantic iterator for looping over object properties. In your console, try Awesome Resources…
Because it bears repeating: javascript and ruby have many features in common, including the ability to add functionality to existing objects…
Javascript and Ruby have many features in common, including the ability to add functionality to existing objects. Ruby monkeypatching Ruby…
or, What the heck is global abatement? tldr: Global variables are code smells. Declaring variables inside an application-level function…
JavaScript has a single number type — a 64-bit floating point number. Since there is no separate integer type, 1 and 1.0 are the same value…
Meteor is a framework that allows you to write web applications using only javascript. All the work is done on the client-side. Meteor…
I am really enjoying Test-Driven Development by Christian Johansen I picked up this little gem this morning as I was learning about…
Spies vs Mocks vs Stubs? We are covering testing frameworks at PCS this week, particularly Jasmine and Sinon. Jasmine has a similar…
Object blocker!! My pair was stuck for the longest time on the following code snip: We expected out output to include three elements — the…