Issue #1 - Toasts, Styled Components and Writing Legible Code Comments
Learn the mental model you need for styled-components, how JavaScript sets can help you, display beautiful toasts, improve code comments, and do you really understand the sort method.
Tip of the day
Getting unique values from an array required the filter
method with the combination of something like includes
to find whether the value already exists or not. But with the new native Set object this is super clean and easy:
let dirtyArray = [1, 1, 3, 4, 5, 3, 4, 2];
let uniqueArray = Array.from(new Set(dirtyArray));
console.log(uniqueArray)
// >> [1, 3, 4, 5, 2]
Articles
The styled-components happy path
Most developers don't fully embrace the power of styled-components, and start working on a project without updating their mental models around styling. This aritcle would explain how you could get most out of it.
by Josh W. Comeau
What is React: A Visual Introduction For Beginners
This article is an introduction to React for beginners, and provides a bird's eye view with an interactive hands-on experience of writing an actual React component. It should probably be the first post that you should go through before getting familiar with its APIs
by Linton Ye
Tools
A sleek library provides a ligthweight, customizable and accessible API for adding beautiful toasts to your app.
by Timo Lins
If you care about the bundle size of your libraries, then this VSCode extension can make your life a hell lot easier. This extension will display inline in the editor the size of the imported package. The extension utilizes webpack with babili-webpack-plugin in order to detect the imported size.
by Wix
Dev of the Week
Vilva Athiban P B
Vilva is a JavaScript developer, International tech Speaker, Open Source Contributor, Seasonal Blogger and YouTuber. He recently started a YouTube video series called PathToExpert, where he posts a daily video which covers advanced content, easy tips and tricks, related to Frontend Development that can help developers to become experts in a year.
Website | GitHub | YouTube | Twitter
Tech Talks
The Art of Code Comments - Sarah Drasner | JSConf Hawaii 2020
Code can describe how, but it cannot explain why. This talk digs into some of the many beneficial types of comments that might all serve a different purpose, followed by patterns you might want to avoid.
Quiz
What is the output of the below snippet?
const numbers = [22,8,19,32,98];
numbers.sort();
console.log(numbers[3])
This week in GIF
Liked this issue? Share on Twitter or read previous issues.