Logging an Object in JavaScript
When printing a JavaScript value to the console, I suggest using an object literal over the raw value. ...
When printing a JavaScript value to the console, I suggest using an object literal over the raw value. ...
A programming style I try to practice could be described as: “there should be only one way out of a function.” Early returns can often cause more confusion than they’re worth. When possible, I avoid them in favor of a single return. ...
The import statements at the top of a JavaScript component file can be a confusing, duplicative, churning mess. Is there a way to organize them that makes sense and scales? In this post, I’d like to share the way I handle this detail. ...
Unused dependencies are bad: they increase the size of your project, slow down your processes, require upgrades, and send incorrect messages to fellow developers about what’s important. Make your project better by periodically auditing your dependencies, and removing those that are unused. ...
A few weeks ago, I built an app with React.js and create-react-app that I call ‘JavaScript Equality’. View deployment here. This application demonstrates the JavaScript value-comparison operators == and ===. It’s inspired by the JavaScript Equality Table. ...
Want to build URLs with JavaScript? Try thewindow.location object. This came from a React.js project we’re working on. It uses ES6 template string interpolation, which isn’t necessary but definitely is nice: `${window.location.protocol}//${window.location.host}/posts/${this.props.postID}/edit` Which becomes: "https://secret-project.com/posts/42/edit"
Don’t miss my next essay
Hear from me immediately when I post: no ads, unsubscribe anytime.