JavaScript DHTML/Object Oriented/prototype
Версия от 09:59, 26 мая 2010; (обсуждение)
Add description property to Number objects
<html>
<head>
<script type="text/javascript">
Number.prototype.description = null;
slHighway = new Number(65);
slHighway.description = "Interstate Highway Speed Limit";
function tellDifference(num1) {
document.write(num1.description);
}
</script>
</head>
<body>
<script type="text/javascript">
tellDifference(slHighway);
</script>
</body>
</html>