Sort by

recency

|

237 Discussions

|

  • + 0 comments
    function sides(literals, ...expressions) {
        const [area, perimeter] = expressions;
        const raizPerimetroArea = Math.sqrt(perimeter ** 2 - 16 * area);
    
        const s1 = (perimeter + raizPerimetroArea) / 4;
        const s2 = (perimeter - raizPerimetroArea) / 4;
        
        const result = [s1, s2].sort();
        
        return result;
    }
    
  • + 0 comments
    function sides(literals, ...expressions) {
        let A = expressions[0];
        let P = expressions[1];
    
        let s1 = (P+(Math.sqrt((P*P)-16*A)))/4;
        let s2 = (P-(Math.sqrt((P*P)-16*A)))/4;
    
        return [s1,s2].sort();
    

    }

  • + 1 comment

    After finishing this problem I reached a conclusion: This has absolutely nothing to do with template literals!

  • + 0 comments
    function sides(literals, ...expressions) {
      const [A,P] = [...expressions]
      let s1 = (P+Math.sqrt(P**2 - 16 *A))/4
      let s2 = (P-Math.sqrt(P**2 - 16 *A))/4
      
      return [s1,s2].sort()
    }
    
  • + 0 comments
    function sides(literals, ...expressions) {
        let square=expressions[1]*expressions[1],air=16*expressions[0];
        let s1=(expressions[1]+Math.sqrt(square-air))/4;
        let s2=(expressions[1]-Math.sqrt(square-air))/4;
        
        let s=[s1,s2];
        s=s.sort();
        return s;
    }