JavaScript

How to Get Current URL in JavaScript [with Useful Examples]

To get the current URL of the page you are visiting using JavaScript, access the window.location.href property: Alternatively, you can access the current URL via document.URL property. However, it has some shortcomings that I’ll explain in a bit. Let’s take a closer look at the window.location object. It has useful properties other than the href

How to Get Current URL in JavaScript [with Useful Examples] Read More »

The Double Exclamation Operator (!!) in JavaScript

In JavaScript, the double exclamation operator converts an Object to Boolean. This happens such that “falsy” objects become false and “truthy” objects become true. For example: This is a comprehensive guide on the double exclamation point operator. About the Double Exclamation Operator: It’s Not an Operator The double exclamation operator (!!) is actually the not

The Double Exclamation Operator (!!) in JavaScript Read More »