Hello and welcome to This Week in JavaScript, our lovingly curated collection of links relating to what’s new and exciting in the world of JS. 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 JavaScript finds …
Getting started
- JavaScript variables hoisting in details - An important aspect of working with variables is hoisting, which defines when a variable is accessible.
- Capturing errors with window.onerror - JavaScript offers some neat ways we can create and deal with errors.
- The recursive way is not the only one to flatten arrays in JavaScript - Recursive or iterative? Sometimes it is good to try solving problem with other approaches.
Learning more
- Cookies vs tokens: The definitive guide - Learn the advantages and get answers to common concerns regarding token authentication.
- Regular expressions in JavaScript - What regular expressions are and what they can do for you, and how regular expressions are used in JavaScript with a practical examples.
- Dropping IE8 support: Consequences for JavaScript - Dropping support for IE8 can have subtle, but profound effects on your JavaScript.
- Instant loading (video) - Building offline-first progressive web apps.
- A Facebook sixth sense - I started thinking about the little status indicator that shows up when one of your friends is writing to you.
- How to write your own Virtual DOM - The main part of Virtual DOM can be written in less than ~50 lines of code.
Libraries
- js-country-code - Map from country codes to country names and vice versa.
- Harnessing the Google Maps JavaScript API the right way - The Maps JavaScript API gives us full control over our map for performance and customization purposes.
- Design and build your own JavaScript library: Tips & tricks - Other than packaged code, what is a library exactly?
- Simplezoom.js - A tiny JavaScript library to preview images in a better way.
- The vanilla JavaScript repository - Coz’ sometimes you feel guilty for using jQuery.
- Microlight.js - Improves readability of code snippets by highlighting, for any programming language, without attaching additional language-packages or styles.
ES2015
- ES2015 maps & weakmaps - Introduction to the new ES2015 Map and WeakMap types, and comparison of their use to that of plain object literals.
- JavaScript factory functions vs constructor functions vs classes - Some think that the
class
keyword solved many problems with constructor functions. It didn’t. - Infinite collections with ES6 generators - Infinite and lazy collections are commonplace in many languages, and they are beginning to find their ways to mainstream Javascript too.
- 3 different kinds of prototypal inheritance: ES6+ edition - Understanding how JavaScript’s native inheritance capabilities work is often neglected, but understanding it can be dramatically empowering.
- Six nifty ES6 tricks - Some benefits that can be gained by new ES6 features.
Frameworks
- React ripples - The ripple effect, ripples everything.
- React D3 library - A JavaScript library that allows developers the ability to use D3 in React.
- Mapping Angular directives to React - How can you map the Angular directives you know over to React?
- Quick Angular 2 hosting with the Angular CLI and GitHub pages - A look at how you can get an Angular 2 web app out to the world quickly.
Testing & Debugging
- 5 common misconceptions about TDD & unit tests - A break down some common misconceptions and hopefully teach you a few things about how you can benefit the most from TDD (Test Driven Development) & unit tests.
- JavaScriptCore CSI: A crash site investigation story - When the bug is at a lower level in WebKit’s JavaScript engine, JavaScriptCore, WebKit engineers need to use a different set of tools to diagnose the issue.
Cool stuff
- Star Wars Episode IV in one picture - An adaptation of Star Wars Episode IV in a style that was inspired by infographics.
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 chrisofarabia.