I had problems too, but I passed the task. Here my solution.

export const min = (a, b, c) => {
if (a <= b && a <= c) {
return a;
} else {
if (a >= b && b <= c) {
return b;
} else {
return c;
}
}
};

Greeting from Venezuela 😄

Had issues, but here is my solution that worked.

export const min = (a, b, c) => {
if (a < b && a < c) {
return a;
} else if ( b < a && b < c) {
return b;
} else {
return c;
}
}

15 days later

My solution if I may 😁
export const min = (a, b, c) => {
if (a<b && a<c){
return (a);
} else
if (b<a && b<c){
return(b);
} else
if (c<a && c<b){
return(c);
} else
if (a===b && a===c && b==c){
return(a,b,c);
}
}

6 days later

How i passed it ->
export const min = (a, b, c) => {
if (a < b) {
if (a < c) {
return a;
} else {
return c;
}
}
if (b < a) {
if (b < c) {
return b;
} else {
return c
}
}
if (c < a) {
if (c < b) {
return c;
} else {
return b
}
}
if (a === b && a === c && b === c) {
return a;
}
}

8 days later

This is the smallest code i can write so far.

 {
if (a < b && a < c) return a;
  else if (b < a && b < c) return b;
  else return c;
}
    12 days later

    Esta es mi solución:
    export const min = (a, b, c) => {
    if (a < b && a < c) return a;
    else if (b < c && b < a) return b;
    else if (c < b && c < a) return c;
    else return a or b or c;
    }

    }

    10 days later

    Well i struggled with it at first but here's my solution 😊
    export const min = (a, b, c) => {
    if((a < b) && (a < c)){
    return a;
    } else if((b < a) && (b < c)){
    return b;
    } else{
    return c;
    }
    }

    2 months later

    techbantu even shorter ;-)

    {
    if (a < b && c) return a;
    else if (b < a && c) return b;
    else return c;
    }

    @Coderslang_Master What I didn't understand is what is the $ sign good for in the solution.js file?

    console.log(The minimum is ${min(a, b, c)});

    And one more thing: With my proposed solution described above, I get the right outcome every time I run the code, but when I submit it, the following step gets marked as incorrect. What's wrong?

    1. The min function should return the minimum of 3 numbers

      alorenz it's the template string, you'll learn it in the future lectures.

      Speaking of the issue with your code, you'll find it if you test with more values. At the very least you should consider the situation when a = b or b = c.

        Coderslang_Master don't get me wrong, nothing against math. it's just that i was fully focused on a possible coding structure error and didn't see that it had more to do with an error with the mathematical logic

          2 months later

          Hello everyone, I hope there’s still time to help.
          here’s my code :

          function findMin(a, b){
              if(a < b){
                  return a;
          }
          return b;
          }
          console.log(findMin(10, 2));
          
          function min3(a,b,c){
              return findMin(findMin(a,b),c);
          }
          
          console.log(min3(10,4,3));

          I tested it. It works

            a month later
            Write a Reply...