Javascript ?? ???? ??? ???
typeof ???
typeof? ??? ??? ??? ???? ? ?????. ?? ??? ?? ?? ??? ?????.
???? ??
???????? ???? ?? ?? ??? ?? ?? ?????.
typeof ?? ?? ??? ???? ?? ?? ?????.
?? ?? ??? ?????.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>檢測數(shù)據(jù)類型</title> <script type="text/javascript"> var box; document.write(typeof box); </script> </head> <body> </body> </html>
? ??? ?? ?? ?????.
?? ??
?? ?:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>檢測數(shù)據(jù)類型</title> <script type="text/javascript"> var box= true; document.write(typeof box); </script> </head> <body> </body> </html>
??? ??
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>檢測數(shù)據(jù)類型</title> <script type="text/javascript"> var box="php 中文網(wǎng)"; document.write(typeof box); </script> </head> <body> </body> </html>
?? ??
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>檢測數(shù)據(jù)類型</title> <script type="text/javascript"> var box=888; document.write(typeof box); </script> </head> <body> </body> </html>
??
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>檢測數(shù)據(jù)類型</title> <script type="text/javascript"> var box={}; document.write(typeof box); </script> </head> <body> </body> </html>
??: ? ??? ??? ?????? ???? ??? ?????
NULL ?? ??
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>檢測數(shù)據(jù)類型</title> <script type="text/javascript"> var box=null; document.write(typeof box); </script> </head> <body> </body> </html>
?? ??
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>檢測數(shù)據(jù)類型</title> <script type="text/javascript"> function box(){ } document.write(typeof box); </script> </head> <body> </body> </html>
??: box? ?????. ?? ?? box(){}???. ???? ?? ??? function
???.