Issue #303 (Try/Catch/Finally, Testing, Git/CLI, JS Utils)05/09/19
James K. Nelson of Frontend Armory wrote a little bit about JavaScript's try/catch/finally constructs on the Frontend Armory blog. If you've used these before, you'll agree that they're pretty straightforward. However, his interactive quiz examples provide some good refreshers — especially if you've never used the finally clause.
Check out his full post, but here are some takeaways:
- A finally clause will always execute, no matter what
- You can supply a finally clause without a catch clause present
- The finally clause will run even if you include a return statement inside the try block (like I said, it runs no matter what!)
- The finally clause will run even if you throw an error in the catch block (did I mention that finally always runs?)
You'll definitely find the live examples in the article useful. And if you're wondering about the usefulness of finally, I like this explanation from MDN:
"It may seem strange to have a special exception-related clause that executes regardless of whether there is an exception, but this construct actually does serve a purpose. The important point is not that the finally-clause always executes, but rather that ordinary code following a try...catch does not."
Now on to this week's tools!
|
Testing and Debugging Tools
Your App! Your App! Your App Is On Fire! 🔥
Put it out with Honeybadger! Simplify your production stack by combining exception, uptime, and check-in monitoring into a single, easy to use platform. You benefit by fixing errors before users even have a chance to complain. 😎 sponsored via ThoughtLeaders
Save Page State
Chrome extension to save the state of a page for remote analysis.
Perflink
Live JavaScript benchmarking. Write scripts and race them. See results graphed out as you type. Share your findings via URL.
x-ray
A simple HTML debugger. Executable by bookmark. X-ray, a sub project of ghost.css, enables you to see the space taken up by each individual element.
Proxay
A proxy server that helps you write faster tests. Use Proxay as a layer between a client and its back end to record interactions and later replay them on demand.
React Quantum
Visualize your React application's component performance metrics with a live heat map.
traq
Super simple email open/click tracking server. For each event, it logs a JSON object to the output. You can then pipe it to any program that you want to further processing.
Polkadot
The tiny HTTP server that gets out of your way.
ExtendsClass
A huge toolbox that includes a Regex tester, JavaScript tester, PHP checker, various tools for encoding, conversion, formatting, diff tools, and lots more.
HTTP View
Newly updated (details). Intercept HTTP(S) with one click, explore and examine traffic up close, and discover exactly what your code is sending.
constyble
A CSS complexity linter, based on css-analyzer. Don't let your CSS grow beyond the thresholds that you provide.
mockit
Stop wasting time mocking APIs. Gives you an interface to configure and create real mocked end points for your applications.
|
Git, GitHub, and Command Line Tools
Tech Productivity
A brief weekly newsletter for tech pros who want to get stuff done. promoted
GitKraken
Now at version 5+ (details). Two tools that help developers be more productive: the Git Client for Windows, Mac and Linux, and Glo Boards for task and issue tracking.
Octotree
Now at version 3+. WebKit and Firefox extension. GitHub code tree on steroids. Navigate code on GitHub with ease.
forever
A simple CLI tool for ensuring that a given script runs continuously (i.e. forever).
nicedoc.io
Aims to reduce the documentation friction, converting any markup file hosted on Github into beautiful documentation.
Pastel
Framework for effortlessly building apps with Ink (React for interactive command-line apps).
define-cli
Command line app to show the definition of a given word, with examples.
confirmation
A simple Node tool to replicate the browser's confirm popup in your CLI.
has-yarn-cli
Check if a project is using Yarn.
git-checkout-interactive
An extension that presents you with the list of branches you are likely to checkout. Instead of typing a long branch name, simply type a number.
|
JavaScript Utilities and Modules
Tech Productivity
A brief weekly newsletter for tech pros who want to get stuff done. promoted
combine-pagination
A JavaScript library for paginating across multiple data sources at once while retaining the sort order.
MDX Blocks
A rich text editor with all the capabilities of components, thanks to MDX (Markdown for the component era).
dequal
A tiny (247b) utility to check for deep equality.
Unicode v12.0.0 data
JavaScript-compatible Unicode data. Arrays of code points, arrays of symbols, and regular expressions for Unicode v12.0.0’s categories, scripts, blocks, bidi, and other properties.
gandul!
A lightweight (<2Kb) non-dependant JavaScript module that adds a different approach on lazy loading focusing on accessibility.
Channel.js
The missing class for creating safe async iterators.
Stepper
Animated numeric stepper component that can be used to increment or decrement a value by clicking arrows.
Tifi
A library for functional programming in TypeScript. It solves a problem of the existence of both `undefined` and `null`.
EasyMDE
A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
Cleave.js
Now at version 1+. Utility to format input fields when the user types (e.g. for credit card numbers, phone numbers, etc).
|
|