tambahkan fungsi
input.addEventListener('change', () => {
const num = parseFloat(input.value);
if (isNaN(num)) {
para.textContent = 'You need to enter a number!';
} else {
para.textContent = `${num} squared is ${squared(num)}. `;
para.textContent += `${num} cubed is ${cubed(num)}. `;
para.textContent += `${num} factorial is ${factorial(num)}. `;
}
});
Concerned Curlew