Categories
JavaScript

Rest and Spread Operators Demystified: A Beginner’s Guide to Enhancing Your Programming Skills

In 2015 ES6 (ECMA Script 6) was introduced. It brought a lot of new and improved features. Two features, among others, that we got with ES6 are rest and spread operators. If you’ve been learning JavaScript or have tried some general programming, you’ve probably come across these handy little tools. In this article, we’ll explore […]

Categories
JavaScript

Top 3 ways to easily detect when a user leaves a page using JavaScript

There are times when we need to detect when a user leaves a web page or clicks on a link. Sometimes we use this data to change something on the website, sometimes to send analytics and sometimes we just need to know this because of something else. In this article, we are going to cover […]

Categories
JavaScript

JavaScript String length

We have already talked about the Array length property, JavaScript Array length – the definitive guide, and now we are going to explain the JavaScript String length property. The JavaScript String length, .length, property is pretty similar to the Array length property with a few little differences. According to MDN: The length property of a […]

Categories
JavaScript

JavaScript substring method through examples

We have covered 2 easy ways to check if JavaScript string contains a substring and JavaScript String replace method, regarding substrings. In this article, we are going to see what is JavaScript substring method and what can we use it for. What is JavaScript substring method JavaScript substring() method returns the part of the string […]

Categories
JavaScript

JavaScript string replace

In our latest JavaScript article, we covered 2 easy ways to check if a JavaScript string contains a substring. In this article, we are going to cover the JavaScript string replace method. According to MDN: The replace() method returns a new string with some or all matches of a pattern replaced by a replacement. The […]

Categories
JavaScript

2 easy ways to check if JavaScript string contains a substring

We can check if JavaScript String contains a substring using pre-ES6 way and ES6 way. ES6 brought a lot of new things that help developers do things faster. The same happened with the checking string for a substring. Check if JavaScript string contains a substring PRE-ES6 In order to check a string for a substring, […]

Categories
JavaScript

Unlimited arguments in a JavaScript function in 2 ways

Passing arguments to a function can be pretty tricky, especially when we are not certain about the number of those arguments. In this article, we are going to cover how can we pass unlimited arguments in a JavaScript function in 2 ways. Number of arguments in a JavaScript function? By default, we can pass as […]

Categories
JavaScript

JavaScript Object Keys

We have already mentioned JavaScript Object Keys when we spoke about Object manipulation in JavaScript. In this article, we are going to cover Object.keys() in-depth. What is the Object? According to MDN, the Object class represents one of JavaScript’s data types. It is used to store various keyed collections and more complex entities. Objects can […]

Categories
JavaScript

JavaScript Array length – the definitive guide

JavaScript Array length property is something we use, almost, every time we work with an array. But, often, we forget how powerful this property can really be. What is JavaScript Array length property The length property of an object which is an instance of type Array sets or returns the number of elements in that […]

Categories
JavaScript Tips&Tricks

How to create custom stackable toasts

Whenever we build some app there is a chance we are going to need stackable toasts. Toasts are basically notifications that inform users of some action that they can’t control. E.g. network connection lost, data saved, there is an error. Sometimes we need to show multiple notifications at once, that is where stackable toasts are […]