PHP Classes

File: js/isPrimeNumber.js

Recommend this page to a friend!
  Classes of bamigboye biodun   Logical Functions   js/isPrimeNumber.js   Download  
File: js/isPrimeNumber.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Logical Functions
General-purpose PHP and JavaScript functions
Author: By
Last change:
Date: 1 year ago
Size: 444 bytes
 

Contents

Class file image Download
const isPrimeNumber = (number) => { if (typeof number !== 'number' || number <= 1) return false; for (var i = 2; i <= Math.floor(Math.sqrt(number)); i++) { if (number % i === 0) return false; } return true; } /* Author : wasp ix Contributor : Biodun Bamigboye Definition : This function receives a Number as argument and returns true or false if its a prime number */