Category Archives: Javascript

JavaScript Random

In the previous tutorial, we learned about JavaScript Math objects, there we also learned about random() method that can generate random numbers. In this tutorial, we will discuss the Math random method in detail because it is one of the most important and widely used JS Math methods. Math.random() The Math.random() method can generate a random number between… Read More »

JavaScript Array Iteration Methods

In the last tutorial, we discussed JavaScript array sorting methods and find the minimum and maximum values from an array. In this tutorial, we will learn about different array techniques and methods to iterate over every array item. Array forEach() method The forEach() mehod is used to call a function on every element or value of the array.… Read More »

JavaScript Arrays

Arrays in JavaScript are used to store multiple values using a single variable name. In this JavaScript tutorial, you will learn how to create and use Arrays in JavaScript. What are Arrays? An array is a collection of multiple values under a single variable name. In the previous tutorials, we learned about JavaScript primitive data types such as… Read More »

JavaScript Numbers

Unlike other programming languages in JavaScript, we only have one type number that represents all the numbers including integers, floats, real, decimal as well as complex. We can either use decimal points or simple integers to represent a number. Example let a = 20; // number without decimal let b = 20.1; // number with decimal To represent… Read More »

JavaScript String Methods

In the previous tutorial, we learned about JavaScript string and how a primitive JavaScript string is different from the JavaScript String() object. As an object can have properties and methods, similarly, various methods and properties are associated with the JavaScript String object. Although both primitive string data types and String() object data types are different in many cases,… Read More »

JavaScript Get Date Methods

The JavaScript Date objects support some of the get methods, that can retrieve specific data from the Date. In this JavaScript tutorial we will learn some of those get methods and how can we use them. JS Date getTime() method The getTime() method is used to return the date in milliseconds since January 1, 1970. Example <script> let… Read More »