javascript笔记(五)
私有成员
<script type="text/javascript"> <!-- function CurrentAnswer(num) { var current=num; var newObject={ getCurrent:function(){return 'The current answer is :'+current;} } return newObject } var curr=new CurrentAnswer('5'); alert(curr.getCurrent()); //--> </script>