Skip to content

Commit 9c5305f

Browse files
add getType
1 parent 152f973 commit 9c5305f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

js.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,13 @@ function isDigit(value) {
504504
}
505505
}
506506
```
507+
- 判断具体类型
508+
```js
509+
function getType(a) {
510+
var typeArray = Object.prototype.toString.call(a).split(" ");
511+
return typeArray[1].slice(0, this.length-1);
512+
}
513+
```
507514
- 设置cookie值
508515
```js
509516
function setCookie(name, value, Hours) {

0 commit comments

Comments
 (0)