#100DaysOfCode (4 Part Series)
Pairing up with someone can do wonders for your coding career. It doesn’t matter if you’re both beginners. You can still learn new things from each other and you can gain a fresh perspective on some concepts that you are stuck on. Also, you will motivate and keep each other going! 👫👭👬
Theory is great but practice is king. While looking for a new coding challenge, I stumbled upon an advanced challenge from Frontend Mentor: REST Countries API with color theme switcher. I decided that I am going to build this using React, more specifically with Hooks. I managed to get done a big chunk of it today. Next, I'm going to work on the design and the color theme switcher and then deploy it tomorrow. Cover picture is a sneak peek of what I managed to build yet. 🇩🇪🇬🇭🇬🇮
The filter() method returns a new array with all elements from the original array that pass a certain test. Example:
const countries = ['albania', 'germany', 'romania', 'ghana', 'denmark', 'china']; const result = countries.filter(country => country.length > 6); console.log(result); // expected output: Array ["albania", "germany", "romania", "denmark"]
In our case we provide a callback function to the filter() method. The callback function, will check for countries that have more than 6 characters in the name.
What did you learn today? Happy coding, until tomorrow!