---
title: "Mads B. Cordes (@madco) | Hashnode"
description: "A fond believer in learning by doing 🧑‍💻. Read the latest articles by Mads B. Cordes on Hashnode."
url: "https://hashnode.com/@madco"
---

@madco

# Mads B. Cordes

@madco · Held hostage by the Danish gov · Joined October 2020

A fond believer in learning by doing 🧑‍💻

[Website](https://hasty.dev/)

## Comments

[I do love to use destructuring for most everything in my JS code-bases 🤓 But your article actually got me curious which one is actually faster 🤔 So I made a quick benchmark seems like they're pretty much on par, so I'll always go with the destructuring then 😍 - Hopefully the V8-team will increase the performance of this in the future though!](https://hashnode.com/posts/destructuring-in-javascript-what-is-it-how-does-it-work-why-should-you-use-it/626f794c238a6ff3d7dc792b/comment/6270bfd69ed78401a6408d8c)

Comment · Article · May 3, 2022 · [Destructuring in JavaScript. What is it? How does it work? Why should you use it?](https://hashnode.com/posts/destructuring-in-javascript-what-is-it-how-does-it-work-why-should-you-use-it/626f794c238a6ff3d7dc792b)

[Ah, had a nagging about this. Thank you! I didn't know what to google, to check for the proper equation. So, thank you for letting me know 🥳](https://hashnode.com/posts/generate-16-unique-avatar-faces-from-40-lines-of-easy-code/616cb574441bd36daa9575e2/comment/616cf9b6441bd36daa9578f1#reply-616cfbc2f1f4c944cc6b2c3b)

Reply · Article · Oct 18, 2021 · [Generate 16 unique avatar faces from 40 lines of easy code](https://hashnode.com/posts/generate-16-unique-avatar-faces-from-40-lines-of-easy-code/616cb574441bd36daa9575e2)

[Brett Thurston Thanks! Glad I'd be of help! 🤓](https://hashnode.com/posts/a-snippy-js-function-to-trim-those-long-strings/601d6dd91054fa16dadd7b0a/comment/601db931072bc516ff6f4647#reply-601dea431054fa16dadd840d)

Reply · Article · Feb 6, 2021 · [A snippy JS function to trim those long strings](https://hashnode.com/posts/a-snippy-js-function-to-trim-those-long-strings/601d6dd91054fa16dadd7b0a)

[Always good with a great truncate-function! Really only thing I'd lay my finger on, is the fact, that the string now gets 3 characters longer when truncated. What I mean is, would it be better to do something like subtracting the length of the ellipsis (...) also, thus making it more compatible with, say, twitter 😇 Also, a way to improve the code maybe: function truncate(string, limit = 160, ellipsis = "...") { limit -= ellipsis.length; if (string.length >= limit) { return string.substring(0, limit) + ellipsis; } return string; } This way, the result will become: const t = truncate("Lorem ipsum dolor sit amet", 20); t // "Lorem ipsum dolor..." t.length; // 20 "Lorem ipsum dolor sit amet".length; // 26 Length is now always 26 chars, instead of truncating on 26, then adding the ellipsis to the end of the string. Though, this is simply a design question! 🤓 Love the article though!](https://hashnode.com/posts/a-snippy-js-function-to-trim-those-long-strings/601d6dd91054fa16dadd7b0a/comment/601db931072bc516ff6f4647)

Comment · Article · Feb 5, 2021 · [A snippy JS function to trim those long strings](https://hashnode.com/posts/a-snippy-js-function-to-trim-those-long-strings/601d6dd91054fa16dadd7b0a)
