---
title: "Tomek Skupiński (@focusinsky) | Hashnode"
description: "Software Engineer, 1/3 of thecode.xyz. Read the latest articles by Tomek Skupiński on Hashnode."
url: "https://hashnode.com/@focusinsky"
---

@focusinsky

# Tomek Skupiński

@focusinsky · Joined April 2022

Software Engineer, 1/3 of thecode.xyz

[Website](https://newsletter.wetwaresnippets.com/)

## Comments

[Hey Leonardo, I think that if you know which elements you need it doesn't matter if the array will change size in the future. Destructuring will ignore any element which you do not use in the assignment e.g let array = \['cat', 'dog', 'bird'\] let \[cat, dog\] = array console.log(cat) // 'cat' console.log(dog) // 'dog' 'bird' is being ignored here. So even if the array changes later it doesn't really matter - you got elements you wanted to assign to variables. If you wanna use the rest of the array but you are not sure how many elements will be there you can use the rest pattern like this: let array = \['cat', 'dog', 'bird'\] let \[cat, ...remainingAnimals\] = array console.log(cat) // 'cat' console.log(remainingAnimals) // \[ 'dog', 'bird'\] As you can see the first element of the array will be assigned to the cat variable and the rest will be assigned as an array to remainingAnimals variable. Also, if for some reason there won't be any element to assign like here: let array = \['cat', 'dog'\] let \[cat, dog, bird\] = array // we try to assign 3 variables from 2 element array console.log(cat) // 'cat' console.log(dog) // 'dog' console.log(bird) // undefined The variable that can't get a matching element will just get an undefined value. Hope this helps, let me know if you have any other questions.](https://hashnode.com/posts/destructuring-in-javascript-what-is-it-how-does-it-work-why-should-you-use-it/626f794c238a6ff3d7dc792b/comment/62943148d97f80b5091dc1d0#reply-62944cdbd97f80b5091dc3e9)

Reply · Article · May 30, 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)

[That's a valid question. I haven't used them (still learning JS and treating these articles as a brain dump after each topic I go through). But the first idea that comes to my mind would be using them in tests whenever I wanna stub some async function. Do you think it would work?](https://hashnode.com/posts/javascript-promises-explained/628c9856bc26026fa45c32ea/comment/628cba43b4bd016fc9a30b63#reply-628cf60ebc26026fa45c44f2)

Reply · Article · May 24, 2022 · [JavaScript promises explained](https://hashnode.com/posts/javascript-promises-explained/628c9856bc26026fa45c32ea)

[nichromat No worries, hit me if you will have any other questions or would like to talk about something code-related. Have a good weekend.](https://hashnode.com/posts/most-common-mistakes-of-not-only-javascript-developers/6274b4baf24a8e4867f926b8/comment/62751d5450c6035691e2aa58#reply-627533f1dc122f5a4f21c328)

Reply · Article · May 6, 2022 · [Most common mistakes of (not only) JavaScript developers](https://hashnode.com/posts/most-common-mistakes-of-not-only-javascript-developers/6274b4baf24a8e4867f926b8)

[nichromat I have added the answer above 😊 Sorry for splitting it into two posts.](https://hashnode.com/posts/most-common-mistakes-of-not-only-javascript-developers/6274b4baf24a8e4867f926b8/comment/62751d5450c6035691e2aa58#reply-6275326f317fc95a74ca6000)

Reply · Article · May 6, 2022 · [Most common mistakes of (not only) JavaScript developers](https://hashnode.com/posts/most-common-mistakes-of-not-only-javascript-developers/6274b4baf24a8e4867f926b8)

[As for the latter. Often people recommend JavaScript as a language you can use to build everything (frontend, backend, games, mobile apps, machine learning, etc.), and while it is true usually there are better tools for the job. The only area where JavaScript is really needed and it is hard to find something better is frontend development. In other fields, there are tailored made tools that usually will make the development experience better. I am building my backends with Ruby on Rails and it is much faster, easier, and more pleasant to work with than node. It doesn't mean you shouldn't use it in other areas if you are just starting but I always encourage people to look for the proper tools for the job. Getting dirty with different technologies can really help you grow. That said if you are just starting sticking to one language is the best strategy, just keep in mind that in the future it might be cool to see what other tribes have to offer.](https://hashnode.com/posts/most-common-mistakes-of-not-only-javascript-developers/6274b4baf24a8e4867f926b8/comment/62751d5450c6035691e2aa58#reply-6275307d317fc95a74ca5fd7)

Reply · Article · May 6, 2022 · [Most common mistakes of (not only) JavaScript developers](https://hashnode.com/posts/most-common-mistakes-of-not-only-javascript-developers/6274b4baf24a8e4867f926b8)

[Thanks, really glad you liked it 😊 As for the first one: When you are in global scope there is no difference between using var and not using any keyword to declare a variable. But if you declare a variable without a keyword (var, let, or const) it becomes available globally no matter when you declare it. Let's look at some examples. function exampleFunction() { var baz = 10; }; printSomething(); console.log(baz); Will throw a ReferenceError because we want to console.log variable which was declared within the scope of function. But if we won't use var keyword like here: function exampleFunction() { bar = 10; }; exampleFunction(); console.log(bar); It will print out 10 because bar is globally available. Hope it helps. Also, you should use let instead of var, I mentioned var because it is still part of syntax but let or const are recommended.](https://hashnode.com/posts/most-common-mistakes-of-not-only-javascript-developers/6274b4baf24a8e4867f926b8/comment/62751d5450c6035691e2aa58#reply-62752f02317fc95a74ca5f75)

Reply · Article · May 6, 2022 · [Most common mistakes of (not only) JavaScript developers](https://hashnode.com/posts/most-common-mistakes-of-not-only-javascript-developers/6274b4baf24a8e4867f926b8)

[Glad you liked it 😊](https://hashnode.com/posts/most-common-mistakes-of-not-only-javascript-developers/6274b4baf24a8e4867f926b8/comment/6274dcf30ef1b05555afceac#reply-6274e06050c6035691e2a0cd)

Reply · Article · May 6, 2022 · [Most common mistakes of (not only) JavaScript developers](https://hashnode.com/posts/most-common-mistakes-of-not-only-javascript-developers/6274b4baf24a8e4867f926b8)

[Hey Mads, that's a great insight. And the cool tool for making benchmarks. I used to play a lot with benchmarks in the Ruby ecosystem (that's the language I have worked with most), need to give it a spin in JS.](https://hashnode.com/posts/destructuring-in-javascript-what-is-it-how-does-it-work-why-should-you-use-it/626f794c238a6ff3d7dc792b/comment/6270bfd69ed78401a6408d8c#reply-6270d5f9339f010181020a14)

Reply · 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)

[Hi Victor, thanks for reaching out. Is there any particular technology you are interested in?](https://hashnode.com/posts/a-beginners-guide-to-understanding-object-oriented-programming-in-javascript/626cce43a2d355d4df43df39/comment/626fa44077f8e2f7fe934711#reply-626fa620fa2b07f7d96a7f72)

Reply · Article · May 2, 2022 · [A beginner's guide to understanding object-oriented programming in JavaScript](https://hashnode.com/posts/a-beginners-guide-to-understanding-object-oriented-programming-in-javascript/626cce43a2d355d4df43df39)
