<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
function fn1(a){
if(typeof a==='number' && a===a) //a是数字且不是NaN
{
alert(a+8);
}else if(typeof a==='string'){
alert(a.charAt(3));
}else if(typeof a==='function'){
a();
}
<
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script>
function fn1(a){
if(typeof a==='number' && a===a) //a是数字且不是NaN
{
alert(a+8);
}else if(typeof a==='string'){
alert(a.charAt(3));
}else if(typeof a==='function'){
a();
}
<