You have the Math builtin object that would do the trick here quite quickly.

a month later

I'm also struggling to get this one to pass.
my solution:

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

It physically seems to work when I run it, but I get to following 2 errors when I run tests:

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

  2. min should not return undefined.

Any ideas?

    a part of my solution

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

    14 days later

    I tried so hard and got so far
    But in the end it .......

    export const min = (a, b, c) => {
    if (b>c && a>c)
    return (c);
    if (a>b && c>b)
    return (b);
    if (b>a && c>a)
    return (a);
    if (a+b===c b+c===a c+a===b)
    return (p);
    if (a===b)
    return (g);
    if (b===c)
    return (q);
    if (c===a)
    return (l);
    }

    still faced :
    the min function should return the min of 3 numbers
    min should not return undefined.

    Beggin for help

      a month later

      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