What is the JavaScript Set in ES2015 and when should you use it?

The ES2015 spec is full of new features that continuously be introduced in all the new browsers. The Set collection is one of those new things.

My first thought was, well I could just use a normal Array! But I will show you what you can do with the Set collection.

3 ways to loop over Object properties with Vanilla JavaScript

It happens a lot that you need to loop over an Array with JavaScript Objects! But sometimes you just don’t know what kind of properties that Object has. Lucky we are that JavaScript offers a few ways of looping over JavaScript Object properties.

How to check equality of values in JavaScript!

In JavaScript, there are 2 comparison operators. The triple equals and the double equals (=== or ==). When I checked JavaScript in an older application, I saw a lot of double equals in it. I thought that couldn’t be right. Then I realized it was built by a few Java developers. If you check the documentation of Java Equality, Relational and Conditional Operators you soon find out why it was written like that.

I Love the JavaScript shorthand of If-else statement 😃

So there it is! It is a long time ago that I put online a new blog post! Did a lot of other stuff then Web Development. But this time I want to share a small nice trick in JavaScript! Yes, I love the JavaScript shorthand of the if-else statement. (For the record, the let variable is an ES6 type variable.) Check the super simple example below. let aVar = 'A'; let conditionalVariable = aVar === 'A' ?
1 of 5 Next Page