# Code HELP! PLZZZ

**URL:** <https://forum.freecodecamp.org/t/code-help-plzzz/324920>\
**Category:** General\
**Created:** [October 31, 2019, 7:23am UTC](https://forum.freecodecamp.org/t/code-help-plzzz/324920 "2019-10-31T07:23:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![riyadif7](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/riyadif7/32/125842_2.png) [@riyadif7](https://forum.freecodecamp.org/u/riyadif7)\
**Post date:** [October 31, 2019, 7:23am UTC](https://forum.freecodecamp.org/t/code-help-plzzz/324920/1 "2019-10-31T07:23:46Z")

</div>

```auto
function sum(arr, n) {
  // Only change code below this line

  if(n=0){ //HERE ! WHY [if(n=0)] WON'T WORK ??
return arr[0];
  }else {
    return sum(arr,n-1)+arr[n];
  }

  // Only change code above this line
}

```

Above , at the 4rth line if i put [if(n=0)] instead of [if(n\<=0)] won’t work. The value of n will never go below zero . Then why n=0 won’t work !! 🤔🤔

---

<div class="post-metadata">

**Author:** ![pjonp](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/pjonp/32/131704_2.png) [@pjonp](https://forum.freecodecamp.org/u/pjonp)\
**Post date:** [October 31, 2019, 7:42am UTC](https://forum.freecodecamp.org/t/code-help-plzzz/324920/2 "2019-10-31T07:42:27Z")

</div>

There is a difference between a = b , a == b, a === b.

> **[Expressions and operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Comparison)**
>
> This chapter describes JavaScript's expressions and operators, including assignment, comparison, arithmetic, bitwise, logical, string, ternary and more.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 2:46pm UTC](https://forum.freecodecamp.org/t/code-help-plzzz/324920/3 "2021-01-16T14:46:15Z")

</div>

Closed on January 16, 2021, 2:46pm UTC


