JavaScript Break and Continue

The JavaScript break and continue statements are very important. The break statement is used to terminate or jump out of a loop and the continue statement is used to skip one iteration or jump over one iteration in the loop. Following are explanations of JavaScript Break and Continue with an example: The Break Statement The … Read more

JavaScript Loops

JavaScript loops are used to execute a block of code many times. Loops are very helpful if we want to run the same code, again and again, each time with a different value. Instead of writing a print statement many times, we can apply a loop and execute it as many as we want. Because … Read more

JavaScript Switch Statement

The switch statement can be used to perform multiple if statement functionality. It is used to perform various actions based on various conditions. The switch statement is used to select one of many code blocks to be executed. Its syntax is given below: Switch Statement – Flowchart The flowchart of the switch statement is given … Read more

JavaScript Comparison and Logical Operators

The JavaScript comparison and Logical operators are important topics in JavaScript. Comparison operators compare two values and give back a Boolean value: either true or false. Comparison operators can be used in conditional statements or in loop statements to compare values and take action depending on the result. JavaScript Comparison Operators To determine the equality or difference between … Read more

JavaScript Conditional Statements

JavaScript Conditional statements are used to control some actions based on various conditions. For different decisions, we want to perform different actions. The JavaScript conditional statements can be used in code for this purpose. If the condition is true it performed an action or if the condition is false it performed another action. JavaScript Conditional … Read more

JavaScript Boolean

The JavaScript Boolean represents a boolean primitive type of true or false values. It is very helpful in controlling workflow in conditional statements. In many situations we might have only one of two values: The Boolean() function can be used to find out if a variable or an expression is true: An expression Boolean value is a basis for all JavaScript … Read more

JavaScript Output

JavaScript doesn’t have any functions for printing or outputting. JavaScript output means different ways to display the given code output. There are many ways to write the output in JavaScript. These methods are as follows: JavaScript Output – innerHTML The document.getElementById(id) method is used to access an HTML element. The id attribute is used to … Read more

JavaScript Random

JavaScript Random numbers are created with Math.random() function. It is mentioned below: Random Function Creating a proper random function to use for all random integer purposes can be a good idea. The following JavaScript function always returns a random number between min (included) and max (excluded): Output: The following JavaScript function always returns a random … Read more

JavaScript Math

JavaScript Math is a built-in object that has properties and methods for mathematical constants and functions. It’s not a function object. The math works with the Number type. It doesn’t work with BigInt. Output: Javascript Math- concept In Javascript math ,Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic … Read more

JavaScript Set Date Method

The JavaScript Date() object helps when working with dates. To create a new object the with current date and time, add the object to your script. The JavaScript Set Date Methods are used to set date values (years, months, days, hours, minutes, seconds, milliseconds) for a Date Object. Following are some methods mentioned: JavaScript setDate() method can be used … Read more