<html>
<body>
<script language="JavaScript">
<!--
var myProp = new Number();
function triple(num){
var result;
result = (num * 3);
return result;
}
Number.prototype.calc3 = triple;
document.write("Example demonstrates the prototype property for the number object."+ "<br><br>");
document.write("150 tripled is: " + myProp.calc3(150) + "<br>");
-->
</script>
</body>
</html>
|