DerickBailey.com

Trade Secrets Of A Developer / Entrepreneur

  •  About
  •  Twitter
  •  G+
  •  RSS
  • Blog
  • Courses
  • Products
  • Newsletter
  • Publications
  • Podcasts
  • Work With Me!

You Need ES2017’s Async Functions. Here’s Why …

April 18, 2017 By Derick

You Need ES2017’s Async Functions. Here’s Why …

With the addition of async functions in JavaScript, our code is about to be dramatically simplified. You need to learn this new syntax now, even if you can’t use it just yet. And I’ll show you the benefits of this new syntax to get you started.

Filed Under: Async Await, Callbacks, Error Handling, ES2017, Functions, JavaScript, Node.js, Promises

Currying: A Functional Alternative To fn.bind

June 24, 2016 By Derick

Currying: A Functional Alternative To fn.bind

In my quest to learn functional programming with JavaScript, I seem to have been focusing on the idea of currying – taking a function that expects more than one argument, and turning it into a series of functions that only take one argument, executing the original function once all required arguments have been supplied. In […]

Filed Under: bind, Context, Currying, Functional JavaScript, Functions, JavaScript, NodeJS, Ramda

Custom Errors w/ Clean Stack Traces in Node.js

May 16, 2016 By Derick

Custom Errors w/ Clean Stack Traces in Node.js

Some recent discussion in the WatchMeCode slack spawned a bit of research into creating custom errors through factory methods, while keeping the stack trace for those errors clean, in Node.js After a bit of digging, I found a good solution using Node’s Error.captureStackTrace method, and recorded a quick screencast to highlight it’s use.  The Screencast […]

Filed Under: API, Code, Error Handling, Functions, JavaScript, NodeJS, Screencasts, WatchMeCode

URI/URL Encoding Strings In JavaScript/Node.js

May 2, 2016 By Derick

I recently found myself needing to URL encode a string, in Node – to convert a space into %20 in this case, but also to handle other scenarios. My initial thought was “oh, great – I’ll need to find a library that doesn’t completely suck”. Turns out I didn’t need to find anything. JavaScript has […]

Filed Under: Decoding, Encoding, ES3, ES5, ES6, Functions, JavaScript, Tips And Tricks, URL

Find An Item By Property, In An Array, Without Using ES6 Methods

February 29, 2016 By Derick

Find An Item By Property, In An Array, Without Using ES6 Methods

A reader recently sent me an email, asking a question about how to find an item in an array, based on a property / attribute that would match. Meaning, the object instance will be different, but the attribute (such as “id”) will be the same.  This person wanted to know if there’s a good way […]

Filed Under: Anti-Patterns, Arrays, ES5, ES6, Functions, Iterators, JavaScript, Patterns, Principles, Tips And Tricks, Variable Scope

What Do You Name The Callback Function?

February 15, 2016 By Derick

What Do You Name The Callback Function?

JavaScript practically requires callback functions to do anything asynchronous. Unless you’re talking about generators, you really can’t get away from them. Callbacks are everywhere. But someone recently asked a question about naming callback methods: Do you use different / standard callback names in different scenarios?  For example,  “next” for Express middleware, maybe “cb” or “callback” […]

Filed Under: Callbacks, Code, Context, ExpressJS, Functions, JavaScript, Naming, NodeJS

Which F Is The IIFE?

December 14, 2015 By Derick

Which F Is The IIFE?

A WatchMeCode subscriber recently emailed a question regarding some code in my Variable Scope episode (part of the JS Fundamentals series). In her question, she points out some code from the episode, wondering if it is still considered an Immediately Invoking Function Expression (IIFE) or not. I watched the variable scope episode and you initially […]

Filed Under: Functions, IIFE, JavaScript, Modules, NodeJS, Patterns, Principles, Variable Scope

Kill .apply With The …Spread Operator

November 16, 2015 By Derick

Kill .apply With The …Spread Operator

A question was asked in a conversation about ES6 recently, about the real use of the ES6 spread operator. This person wanted a slightly better explanation than they had seen previously, as they weren’t yet sure of where this new operator was really useful.  There are several things that this new operator can do, but […]

Filed Under: ES6, Functions, JavaScript, Spread Operator, Tips And Tricks

How Does A JavaScript Function Define A Type And Create Object Instances?

November 9, 2015 By Derick

How Does A JavaScript Function Define A Type And Create Object Instances?

I recently received a question from someone going through my Mastering JavaScript “this” email course, regarding day 3 of the course, where I talk briefly about constructor functions and the “new” keyword. In this course, I say: The value of “this” inside of the constructor function is a new instance of that object type, where […]

Filed Under: Classes, Context, ES6, Functions, JavaScript, NodeJS, OOP, Prototypes

Fun With Higher Order Functions In JavaScript

October 21, 2015 By Derick

Fun With Higher Order Functions In JavaScript

JavaScript is often referred to as a language with functional programming capabilities because of it’s “higher order functions” – a term that may sound fancy, off-hand, but turns out to be simple in practice: A higher order function is a function that can return another function. It’s a bit like a opening a present and […]

Filed Under: Bindings, ES6, Functions, JavaScript, OOP, Patterns, Promises

Derick Bailey Around The Web

  • Twitter: @derickbailey
  • Google+: DerickBailey
  • Screencasts: WatchMeCode.net
  • eBook: Building Backbone Plugins

Copyright © 2016 Muted Solutions, LLC. All Rights Reserved · Log in