Use Window.location.href to get the URL of the current page.
JavaScript Arrays Explained
Arrays are container-like values that can hold other values. The values inside an array are called elements.
Get the direction of the text selection
This function returns forward if user selected text from the left to right. It returns backward in the other case.
Get and set inline styles for an element
Get a style, and then if this style is not set as an inline style directly on the element, it returns an empty string.
One-Liner If-Else Statements
Instead of writing an if-else on multiple lines, you can use the ternary operator to write the whole statement with one line of code.
Get the currently selected text with JavaScript
Use Window.getSelection() and Selection.toString() to get the currently selected text.
Javascript Conditionals Explained
Conditional statements control behavior in JavaScript and determine whether or not pieces of code can run.
Get the default value of a CSS property with JavaScript
The following function returns the default value of CSS property for given tagName.
How to loop through arrays and array-like objects in JavaScript
Here is how to loop through arrays and array-like objects using JavaScript.
How to Get the Query String in JavaScript
When you’re working with JavaScript, sometimes you need to access query string parameters in your script.










