This Week in JavaScript - 21 March 2016

Hello and welcome to ‘This Week in JavaScript’, this week, coming to you from the heart of Texas and SXSW — another curated collection of links relating to what’s new and exciting in the world of JavaScript. The complete list is tagged jsweekly. (Don’t forget to check out our weekly .NET and front end roundups too!)

And now for this week’s finds …


Getting started

  • Which F Is The IIFE? - To really understand what’s happening and to answer the questions, then, it’s best to break this down into individual parts and put it all back together again.
  • JavaScript Debugging Tips from the Trenches - JavaScript. The combination of dynamic typing, liberal use of state mutation, closures, and asynchronousity can lead to bugs that are frightening to try and fix, but help is at hand.
  • Three Ways to Reverse a String in JavaScript - Reversing a string is one of the most frequently asked JavaScript question in the technical round of interview.

Learning more

Libraries

  • An Introduction to jQuery’s Deferred Objects - Deferred objects were introduced to jQuery years before promises were introduced to ECMAScript. In this article, Aurelio De Rosa discusses what Deferred objects are, and what problems they try to solve.
  • List.js v1.2.0 - Tiny, invisible and simple, yet powerful and incredibly fast vanilla JavaScript that adds search, sort, filters and flexibility to plain HTML lists, tables, or anything.
  • Functional Programming in Javascript Using RxJS - This is a series of interactive exercises for learning Microsoft’s Reactive Extensions (Rx) Library for Javascript. So why is the title “Functional Programming in Javascript”? Well it turns out that the key to learning Rx is training yourself to use functional programming to manipulate collections.
  • Sweet.js - In super-cool news the redesign is now self-hosting! Sweet.js is once again building sweet.js!
  • All js libraries should be authored in TypeScript - André Staltz believes all JavaScript libraries which are intended to be used by thousands of developers should be written in TypeScript - in this article, he explains why.
  • jQuery 1.12.2 and 2.2.2 Released - These releases include a few bug fixes, which includes two edge case bugs for jQuery.isPlainObject and a bug when setting the selected property on an option element using the .prop() method in IE 11.

ES6

Frameworks

  • Developing Apps with Angular 2 MockBackend - The focus of this article is to present a way that front-end teams can become independent of the back-end and at the same time provide a useful interface which reduces the risk of structural changes.
  • The need for multi-platform npm packages - Dr. Axel Rauschmayer argues that it should be possible to have multiple implementations of the same npm package (same name, same version).
  • How to Build Charts in Angular - A tutorial on how to visualize data using Angular. Learn how to make beautiful charts using Angular, FusionCharts and its Angular charts plugin.

Testing

  • Writing Testable Code in JavaScript: A Brief Overview - Organizing and writing code that is easily testable takes some effort and planning, but there are a few patterns, inspired by functional programming concepts, that we can use to avoid getting into a tough spot when it comes time to test our code. In this article, we will go through some useful tips and patterns for writing testable code in JavaScript.
  • Code for edge cases - When testing helper functions, developers usually write the code for the perfect scenario without considering anything that could go wrong.

Other Stuff


For more links like this and to keep up-to-date with the latest goings on in JS land, you can follow SitePoint’s JavaScript channel on Twitter.
Please PM us if you have anything of interest for the next issue or if there is anything you would like to see featured. Paul and Chris of Arabia.

6 Likes

Excellent stuff.

With the IIFE article, I’m with Douglas Crockford who prefers to have the invoking parenthesis inside of the wrapper parenthesis.

(function () {
    ...
}());

Because, the above makes it clearer that the purpose of the wrapping parenthesis is just to allow the function to be invoked.

The alternative where the invoking parenthesis are hanging off the end, Crockford claims looks like dog balls, and I’m with him on that one:

(function () {
    ...
})();

The above code raises more questions, such as why are the wrapping parenthesis being invoked? And, it’s a change of structure from how all other functions are normally invoked.

Crockford clarifies this in this video excerpt (video 1m 37s)

Dog balls indeed.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.