Category Archives: JavaScript
Mastering check data types in Javascript
This article will help you to check data types in Javascript whether a variable or parameter is a string, number, array, object, function, null & undefined, boolean, regexp, error or date. Table of contents How do you check if a variable is a String in Javascript How do you check if a variable is a […]
Best Way To Validate Email In Javascript
Javascript is one of the most trending programming language these days. Be it frontend development or backend development, Javascript used widely in almost every field of web development. While the development of any websites or applications using the Javascript, we have to create a contact form, signup form, sign in form, or any other type […]
How to iterate over Javascript object properties
Here some very common tasks how to iterating over an JavaScript object properties If you have an object, you can’t just iterate it using map(), forEach() or a for..of loop. You will get the following errors: map() function will give you TypeError: items.map is not a function: forEach() function will give you TypeError: items.forEach is not a function: for..of will give you TypeError: items […]
Map vs forEach in JavaScript – What Is the Difference?
One of my most loved functions in JavaScript might be map() and forEach. They both started to exist since ECMAScript 5, ores5 in short. On that post, I am going to talk about the main difference between each and show you some examples of their usages. Basically, looping over an object in JavaScript counts on whether or not the […]
When (and why) you should use ES6 arrow functions — and when you shouldn’t
Arrow functions are undoubtedly one of the more popular features of ES6. They introduced a new way of writing concise functions. Here is a function how is written in ES5 syntax: Now, here is the same function expressed as an arrow function: It’s much shorter! We are able to omit the curly braces and the […]