私有成员

 <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>

相关文章:

  • 2021-07-01
  • 2022-02-05
猜你喜欢
  • 2021-07-04
  • 2021-07-11
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
相关资源
相似解决方案