利用Object.prototype.toString.call(val)判斷數據類型
返回值會以下列形式返回:
1. null => "[object Null]"
2. undefined => "[object Undefined]"
3. true => "[object Boolean]"
4. 1 => "[object Number]"
5. '' => "[object String]"
6. [] => "[object Array]"
7. {} => "[object Object]"
8. function () {} => "[object Function]"
9. new Date() => "[object Date]"
10. /./ => "[object RegExp]"
11. Math => "[object Math]"
12. Math.max() => "[object Number]"