작성
·
160
0
const isItTriangle = (A, B, C) => {
// Step 1: Construct a function that takes three arguments
// Step 2: Compare the sum of two values to one arg
// Step 3: If the sum is greater than the one arg, return true otherwise false
if (A + B > C && A + C > B && B + C > A) {
return 'YES';
} else {
return 'NO';
}
}
console.log('Case 1: ' + isItTriangle(6, 7, 11));
console.log('Case 2: ' + isItTriangle(13, 33, 17));
const answer2 = document.querySelector('#q3');
answer2.append(isItTriangle);