Simple if/else statement

Tell us what’s happening:
Hi
i was wondering if i can do this challenge with a simple and straight forward -If statement- i was thinking it simple but now i’m kinda blank.
so do you have any idea how to tackle this in an easy way?

Your code so far


function addTogether(a ,b) {
  
  var func ;
  ///*
  if(func = a ){
   func +=  b;

  }else if (func = (a)){
    func += b;

  }else if (func = (b)){
    func += a;
  }//*/

  console.log(func);
  
  return undefined;
  
}

addTogether(2,3);

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/arguments-optional

An equality operator in Javascript is ==, whereas the = you’re using in the if-statements means you’re assigning those values to func instead of comparing them to func.

Hope this helps.