Category Archives: Javascript

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 »

JavaScript Strings

String data type in JavaScript is used to store a sequence of text values. We generally use the JavaScript string to represent textual data. A string value can have zero or more than zero characters, and to wrap up the string characters we can use single quotes, double quotes or backticks. Example <script> var name1 = “Rohan Singh”;… Read More »