In this example we will display the current date and time in JavaScript Example 1 // get local machine date time const date = new Date(); // get the date …
Programs
-
-
In this example we will check that two strings match You will see that the pattern below has the following gi, this means Flags Description g Performs a global match …
-
In this example we will compare 2 strings to see if they are a match Example 1 First of all we convert the strings to lowercase using .toLowerCase() method, you …
-
In this example we will replace a string in another string using JavaScript This time will use regular expressions We will define a string, then we will define t he …
-
In this example we show you how to generate random strings in JavaScript Example 1 We will define a list of characters which will include lower and upper case A …
-
In this example we will show you how to generate a multiplication table Example 1 We take the user input and store in the constant number We then use a …
-
Even numbers are those numbers that are exactly divisible by 2. The remainder operator % will give the remainder when used with a number. Example 1 // program to check …
-
In this article we will convert from celsius to fahrenheit The formula is fahrenheit = (celsius * 1.8) + 32 Example 1 This will prompt a user for input The …
-
In this example we show how to add 2 numbers in JavaScript We use the + operator to add two or more numbers. Example 1 const num1 = 6; const …
-
In this example we show how to find the largest of three user inputted integers We will use an if – else statement Example using System; namespace ConsoleApp1 { …