Thu. Nov 7th, 2019

Host your Website

Read and learn

FatCow Plan for $3.15/mo. only

Prime Numbers in JavaScript

1 min read



Prime Numbers:
A prime number is a positive integer that can only be exactly divided by the integers 1 and itself without leaving a remainder. For example 7 is prime, because it can only be divided by 1 and 7. If you divide it by say 2, you get 3 with a remainder of 1. Because you get the remainder, the division is not exact.

So a prime is a whole number, and the only whole numbers that exactly divide into it, without a remainder, it are one and the number itself.

Break Statement:
The break statement can be used with decision-making statements, such as switch-case and loop constructs, such as for and while loops. The break statement is denoted by using the break keyword. It is used to exit the loop without evaluating the
specified condition. The control is then passed to the next statement immediately after the loop.

Copyright © All rights reserved. | Newsphere by AF themes.