JavaScript Const

The JavaScript const variable is also used to declare a variable like var. But we cannot redeclare const in the whole program. The const keyword was introduced in ES6. The JavaScript const variables should be assigned the value at the time of declaration. The JavaScript const should be used when we declare There is a … Read more

JavaScript Sorting Arrays

In JavaScript sorting arrays can be done in many ways. These ways are mentioned below: Sorting an Array The sort() the method is used to sort array elements in place. It changes the element’s place in the original array: Output: Reversing an Array The reverse() the method is used to reverse the elements in an array. To sort arrays … Read more

JavaScript Get-Date Methods

The JavaScript Get-Date Methods are used to get information from a date object. In this post, we’ll learn how to retrieve different date methods in Javascript from the date object. In JavaScript, there are several ways to get the date. A date object’s data values can range from years, months, days, hours, minutes, seconds, and … Read more

JavaScript String Methods

The JavaScript string methods help to work on strings. JavaScript methods and properties help to work with primitive values. Following are some methods that are used to work with strings in JavaScript. String Length To check the length of a string in JavaScript the length property is used: Output: Converting to Upper and Lower Case A … Read more

JavaScript Arithmetic

JavaScript arithmetic operators are used to perform arithmetic operations on numbers (like variables or literals). An arithmetic operation is performed on 2 numbers typically. These numbers are known as an operand and the operation is done by an operator. Following are some basic JavaScript arithmetic operators: Operator Description + Addition – Subtraction * Multiplication ** … Read more

JavaScript Array Methods

The JavaScript array methods help to work on arrays. Following are some JavaScript array methods that are used to work with arrays in JavaScript. Arrays to String Conversion The toString() the method is used to convert an array to a string of array values. Output: The join() the method also works the same as toString(), but it specifies the separator: … Read more

JavaScript Dates

In the JavaScript Dates topic, you can learn how JavaScript supports date and you can create it. Date objects represent a single moment in time in a platform-independent format. Time-zones There are hundreds of time zones in our world. In JavaScript, we only care about two—Local Time and Coordinated Universal Time (UTC). By default, almost … Read more

JavaScript Data Types

JavaScript Data types have an important concept in JavaScript. It contains various data types such as numbers, objects, strings, and more. Java Script executes expressions from left to right different sequences will give different results. JavaScript Types are dynamics means that we can use the same variable to execute the different data types: JavaScript Data … Read more

JavaScript Operators

JavaScript Operators are special symbols used to perform operations on operands (values and variables). JavaScript operators include operators as in other languages. For example, 1 * 2, where * sign is an operator and 1 is left operand and 2 is a right operand. + operator adds two numeric values and produces a result which … Read more

JavaScript Statements

In programming, instructions executed by a computer are called statements. There is a list of JavaScript statements. JavaScript programs are executed by a web browser in HTML. JavaScript statements are the individual instructions that make up a JavaScript program. These statements are executed line by line, from top to bottom, and perform a specific action. … Read more