<!DOCTYPE html>
<html>
<head>
<title>Custom Prototype Method</title>
</head>
<body>
<h2>Prototype Sum Method</h2>
<button onclick="calculate()">Click to Calculate</button>
<script>
// ✅ Add custom method using prototype
Number.prototype.add = function(num) {
return this + num;
};
function calculate() {
let result = (10).add(20); // using custom method
alert("The sum is: " + result);
}
</script>
</body>
</html>