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! 👫👭👬
Today, I started by diving deeper into more advanced JavaScript concepts like callbacks, promises and async/await. I recommend this video for a wonderful explanation of these:
The Evolution of Async JavaScript: From Callbacks, to Promises, to Async/Await 📺
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. 🇩🇪🇬🇭🇬🇮
JavaScript Concept of the Day: Array.filter()
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!
✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
Top comments (0)