Posts

Javascript Logo

How to get the last item in an array?

< 1 min readTo get the last item in an array in JavaScript, you can use the length property of the array to access the last element. The length property returns the number of elements in the array, so to get the last element, you can use the following syntax: Alternatively, you can use the pop() method, which…

Read More
Javascript Logo

How to refresh a page using javascript?

< 1 min readTo refresh a page using JavaScript, you can use the location.reload method of the window.location object. The location.reload method reloads the current page from the server, and it has an optional argument that specifies whether to reload the page from the cache or from the server. Here is an example of how to use the…

Read More
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