Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 380 Bytes

README.md

File metadata and controls

29 lines (18 loc) · 380 Bytes

isPrime

Check if number is prime

Example

https://maper77.github.io/isPrime/

Use

<script type="module">
    import isPrime from "./index.js";
    const [ result, list ] = isPrime(17);
    console.log(result, list);
</script>

result : boolean

list: array - (all prime numbers up to the given number)


result: true
list: [2, 3, 5, 7, 11, 13, 17]