tldr: 🚀🚀🚀subscribe to my web development newsletter and let's grow our skills as developers together!
13 is my lucky number. And this is my 13th article in my codesnacks series. So I hope I'm lucky and you forgive me for some self-promotion.
Currently, it's mostly vanilla JS content but it will also be about React, Vue, Node.js, Svelte, or other topics. Primarily I write snackable content.
I try to communicate one specific idea or one trick I learned in less than 5 minutes, hence the name codesnacks.
If you'd like to receive a small newsletter every week with my tutorials and other stuff I liked, then please subscribe to my Tutorial Tuesday newsletter.
It will contain stuff like this:
💡 Dealing with command line arguments in Node.js
Learn how to read command-line arguments in Node.js.
Learn about coercion - implicit and explicit. Which methods use coercion and what the implications are.
const 📦, seal 🤐, freeze ❄️ & immutability 🤓 in JS
Learn about the Object.seal and Object.freeze method, their limitations and what distinguishes them from immutability
As a small thank-you I'd like to share one little hack with you to access the last element of an array:
So instead of doing it like this
const arr = [1, 2, 3] const lastElement = arr[arr.length - 1]
You can also use
const arr = [1, 2, 3] const lastElement = arr.slice(-1).pop()
You might ask why you want to use this syntax. Well, you don't need to save your array to a variable this way.
Let's say we want to get the last link of a webpage. You could do it like this, without saving the list of links into an additional array:
Want to get better at Web Development?
🚀🚀🚀subscribe to the Tutorial Tuesday ✉️newsletter