// program to check an Armstrong number of n digits// take an inputconstnumber = prompt("Enter a positive integer");constnumberOfDigits = number.length;letsum =0;// create a temporary variablelettemp = number;while(temp >0) {letremainder = temp %10; sum += remainder ** numberOfDigit...
For example, 2, 3, 5, 7, 11 are the first few prime numbers. Example: Check Prime Number // program to check if a number is prime or not // take input from the user const number = parseInt(prompt("Enter a positive number: ")); let isPrime = true; // check if number is ...
We are required to write a JavaScript function that takes in two numbers, say, a and b and returns the total number of prime numbers between a and b (including a and b, if they are prime). For example − If a = 2, and b = 21, the prime numbers between them are 2, 3, 5,...
JavaScript exercises, practice and solution: Write a JavaScript program which iterates the integers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples o
Declare an array & print using for loop Password strength checker in JavaScript Print characters of a string in multiples of N Check whether a string contains a substring break in nested loops Understanding callbacks Create accordions Check number is Perfect or not Check number is Armstrong or not...
// program to check if the number is even or odd // take input from the user const number = prompt("Enter a number: "); //check if the number is even if(number % 2 == 0) { console.log("The number is even."); } // if the number is odd else { console.log("The number...
Example 1: Find HCF using for Loop // program to find the HCF or GCD of two integerslethcf;// take inputconstnumber1 =parseInt(prompt('Enter a first positive integer: '));constnumber2 =parseInt(prompt('Enter a second positive integer: '));// looping from 1 to number1 and number2fo...
hapijs/joi - The most powerful data validation library for JS react-grid-layout/react-grid-layout - A draggable and resizable grid layout with responsive breakpoints, for React. paularmstrong/normalizr - Normalizes nested JSON according to a schema jsdom/jsdom - A JavaScript implementation of va...
react-grid-layout/react-grid-layout - A draggable and resizable grid layout with responsive breakpoints, for React. paularmstrong/normalizr - Normalizes nested JSON according to a schema jsdom/jsdom - A JavaScript implementation of various web standards, for use with Node.js avajs/ava - Node....
paularmstrong/normalizr - Normalizes nested JSON according to a schema fabricjs/fabric.js - Javascript Canvas Library, SVG-to-Canvas (& canvas-to-SVG) Parser jlmakes/scrollreveal - Animate elements as they scroll into view. react-bootstrap/react-bootstrap - Bootstrap components built with React...