Javascript : Get current url

Hello friends, if you want to have the URL address of a page in JavaScript you can use the following function: window.location.href Here is an example: Explanations: var pageURL = window.location.href : put the page URL in the variable. console.log(pageURL) : display the URL.

Javascript : charCodeAt()

For JavaScript strings, there is also the charCodeAt() function. It provides back the character’s Unicode value at a given string index. The charCodeAt() method takes an index as an input. Function string.charCodeAt(index) Explanation string: The string from which to retrieve the Unicode value.index: The zero-based index of the character whose Unicode value is to be … Read more

Javascript : charAt()

For JavaScript strings, there is a method called charAt(). It is employed to extract the character from a string at a certain index. The charAt() method takes an index as an input and returns the character that is at that index. An empty string is returned if the index is out of range (less than … Read more