Different background color based on position

I wanted to have different background colors for post tiles for one of my webpages. The goal was to dynamically set a specific color since there will be more posts in the future. Here I’m going to show how to achieve this with CSS. nth-of-type In the below example we have a grid with 4 … Read more

Hackerrank Solution: arrays and Set in JavaScript

In this post I’m going to show you one possible solution of one of the 10 Days of JavaScript challenges from Hackerrank. We’re going to use Set object to return a second largest number from an original array. Challenge Full description of the challenge: 10 Days of JavaScript. Day 3: arrays. I really recommend registering … Read more

Hackerrank Solution: switch in JavaScript

In this post I’m going to show you one possible solution of one of the 10 Days of JavaScript challenges from Hackerrank. We’re going to use switch statement to return a letter depending on the first letter of provided string. Challenge Full description of the challenge: 10 Days of JavaScript. Day 2: switch. I really … Read more

Hackerrank Solution: for-of loop in JavaScript

In this post I’m going to show you one possible solution of one of the 10 Days of JavaScript challenges from Hackerrank. We’re going to use for-of loop to first print vowels and then consonants in a given string. Challenge Full description of the challenge: 10 Days of JavaScript. Day 2: loops. Solution and explanation … Read more