Skip to content

Commit d6f8bb6

Browse files
committed
Update gettype per current behavior and add additional array and array-like tests
1 parent 03f0483 commit d6f8bb6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

functions/var/gettype.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@ function gettype(mixed_var) {
1313
// * example 2: gettype(undefined);
1414
// * returns 2: 'undefined'
1515
// * example 3: gettype({0: 'Kevin van Zonneveld'});
16-
// * returns 3: 'array'
16+
// * returns 3: 'object'
1717
// * example 4: gettype('foo');
1818
// * returns 4: 'string'
1919
// * example 5: gettype({0: function () {return false;}});
20-
// * returns 5: 'array'
20+
// * returns 5: 'object'
21+
// * example 6: gettype({0: 'test', length: 1, splice: function () {}});
22+
// * returns 6: 'object'
23+
// * example 6: gettype(['test']);
24+
// * returns 6: 'array'
2125
var s = typeof mixed_var,
2226
name;
2327
var getFuncName = function(fn) {

0 commit comments

Comments
 (0)