Given a large angle, or a negative angle, a number equal to 0 or bigger, and smaller than 360 is returned.
Introducing operators
You’ll get familiar with JavaScript’s operators. Assignment operators, arithmetic operators, comparison operators, logical and conditional operators… This is another chapter of my old, unfinished book, ‘JavaScript Class’. You’ll get familiar with operators really soon, that’s because you already know the basics of them. Yes, you do. You learned about them in your first years of […]
Get the greatest common divisor
This efficient JavaScript function returns the greatest common divisor of a series of numbers.
Get the Last Day of the Month
This one line JavaScript function gets the last day of the month, for the specified month and year.
Back, Forward and Refresh using JavaScript
Navigating back, forward and refreshing the browser page using JavaScript.
Preload images using JavaScript
This code shows you how to preload a set of images using JavaScript so that you can later use them without having to wait for them to load.
Ask for confirmation on form submit
Show a confirmation dialog upon submitting a dialog by using a standard button with a little JavaScript instead of a typical submit button.
Checking For Leap Years
This tutorial will show you how to create a JavaScript function that checks whether a given year is a leap year (366 days) or not (365 days). In this tutorial I aim to teach you how to check valid leap years in JavaScript. Basically I want you to be able to understand how to go […]
Animated Color Matrix
This tutorial, especially recommended to beginners, will give you a better understanding of the JavaScript language: how to use loops, arrays and functions to create a fun animation. This JavaScript will make the background color of a few DIV objects change by creating animation patterns. Let’s start by creating the HTML that will later be […]
Rotate Array in JavaScript
A function for rotating arrays to the right or to the left, any number of times.