javascript学習ノート—判定値と関数の種類


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <script type="text/javascript">
	/*
	        :
			number:  
			string:   
			boolean:  
			null: 
			undefined:   

	      :typeof
	
	      
		Number()、parseInt() parseFloat()

	Boolean()    
	    false:
			 null 
			 undefined 
			     "" 
			   0 
			  null    
	*/

	<!--      -->
	var width;
	var arrlist=new Date();
	document.write(typeof("woanji")+"<br />"); //   string
	document.write(typeof(12)+"<br />"); //   number
	document.write(typeof(true)+"<br />"); //   boolean
	document.write(typeof(null)+"<br />"); //   object
	document.write(typeof(arrlist)+"<br />"); //   object
	document.write(typeof(width)+"<br />"); //   undefined
	
	function test(a,b){
		alert("sum:"+(a+b));
	}
	//               ,  boolean  
	document.write(test instanceof Object);//   true,           
	var sss = "123sdfg";
	document.write(sss instanceof String); //   false,  sss  string   
  </script>
 </head>

 <body>
  
 </body>
</html>