We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functionsides(literals,...expressions){letareaPerimeterArr=[...expressions];lets1=(areaPerimeterArr[1]+Math.sqrt(areaPerimeterArr[1]*areaPerimeterArr[1]-16*areaPerimeterArr[0]))/4;lets2=(areaPerimeterArr[1]-Math.sqrt(areaPerimeterArr[1]*areaPerimeterArr[1]-16*areaPerimeterArr[0]))/4;letsides=[s1,s2].sort(function(a,b){return(a-b)});// let sortedArr=sides.sort(function(a,b){return (a-b)})returnsides;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 5: Template Literals
You are viewing a single comment's thread. Return to all comments →