📌  相关文章
📜  Day 5: Template Literals hackerrank 10 天的 javascript 解决方案 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:46.510000             🧑  作者: Mango

代码示例1
//Day 5: Template Literals hackerrank 10 days of javascript solution
function sides(literals, ...expressions) {
    const [area, perimter] = expressions;
    const s1 = (perimter + Math.sqrt(Math.pow(perimter,2) - 16 * area))/4;
    const s2 = (perimter - Math.sqrt(Math.pow(perimter,2) - 16 * area))/4;
    return [s1,s2].sort();
}