# Help mea please, JS function

**URL:** <https://forum.freecodecamp.org/t/help-mea-please-js-function/46265>\
**Category:** General\
**Created:** [October 17, 2016, 12:46pm UTC](https://forum.freecodecamp.org/t/help-mea-please-js-function/46265 "2016-10-17T12:46:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WilliamVane](https://avatars.discourse-cdn.com/v4/letter/w/a4c791/32.png) [@WilliamVane](https://forum.freecodecamp.org/u/WilliamVane)\
**Post date:** [October 17, 2016, 12:46pm UTC](https://forum.freecodecamp.org/t/help-mea-please-js-function/46265/1 "2016-10-17T12:46:02Z")

</div>

I’m new in JS but i need to make a task… I need a function which should wait for an integer parameter and return true in case number is prime or false in other case. I know that this is simple task but i don’t understand JS.

---

<div class="post-metadata">

**Author:** ![BenGitter](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bengitter/32/12192_2.png) [@BenGitter](https://forum.freecodecamp.org/u/BenGitter)\
**Post date:** [October 17, 2016, 12:53pm UTC](https://forum.freecodecamp.org/t/help-mea-please-js-function/46265/2 "2016-10-17T12:53:20Z")

</div>

Hi, have you started with the JS section?

I suppose you could try a for loop (from i = 2 to N-1) and check if N % i === 0. If so, N (input param) is not a prime (because it can be divided by another number).

---

<div class="post-metadata">

**Author:** ![WilliamVane](https://avatars.discourse-cdn.com/v4/letter/w/a4c791/32.png) [@WilliamVane](https://forum.freecodecamp.org/u/WilliamVane)\
**Post date:** [October 17, 2016, 1:03pm UTC](https://forum.freecodecamp.org/t/help-mea-please-js-function/46265/3 "2016-10-17T13:03:04Z")

</div>

thx, i’ll try to make like this

---

<div class="post-metadata">

**Author:** ![jwilkins.oboe](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jwilkins.oboe/32/179497_2.png) [@jwilkins.oboe](https://forum.freecodecamp.org/u/jwilkins.oboe)\
**Post date:** [January 16, 2021, 5:30am UTC](https://forum.freecodecamp.org/t/help-mea-please-js-function/46265/4 "2021-01-16T05:30:39Z")

</div>


