Create a function that finds the maximum range of a triangle's third edge, where the side lengths are all integers.
Examples:
nextEdge(8, 10) ➞ 17
nextEdge(5, 7) ➞ 11
nextEdge(9, 2) ➞ 10
Notes:
We will use this algorithm to find the maximum range of a triangle's third edge
(side1 + side2) - 1 = maximum range of third edge.
<script>
function nextEdge(side1, side2){
return (side1 + side2) - 1;
}
var side1 = 8;
var side2 = 10;
console.log(nextEdge(side1, side2)); //this will print 17
</script>