Javascript Logo

How to get query string values in javascript?

< 1 min readTo get query string values in JavaScript, you can use the URLSearchParams object of the URL object. The URLSearchParams object allows you to parse and access the query string of a URL, and it provides several methods for retrieving and manipulating the query string parameters. Here is an example of how to use the URLSearchParams…

Read More
Javascript Logo

How to get the current URL in javascript?

< 1 min readTo get the current URL in JavaScript, you can use the window.location object of the window object. The window.location object contains information about the current URL, and it provides several properties and methods for accessing and manipulating the URL. Here are some examples of how to use the window.location object to get the current URL…

Read More
Javascript Logo

What is closure in Javascript?

2 min readIn JavaScript, a closure is a function that has access to the variables and parameters of its outer function, even after the outer function has returned. Closures are created when a function is defined inside another function, and they allow the inner function to retain its access to the variables and parameters of the outer…

Read More