Skip to content

Commit cd22619

Browse files
committed
Fixed strval#1
1 parent dfe0a24 commit cd22619

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

functions/var/strval.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@ function strval (str) {
33
// + original by: Brett Zamir (http://brett-zamir.me)
44
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
55
// + bugfixed by: Brett Zamir (http://brett-zamir.me)
6-
// % note 1: Comment out the entire switch if you want JS-like behavior instead of PHP behavior
76
// - depends on: gettype
87
// * example 1: strval({red: 1, green: 2, blue: 3, white: 4});
9-
// * returns 1: 'Array'
8+
// * returns 1: 'Object'
9+
1010
var type = '';
1111

1212
if (str === null) {
1313
return '';
1414
}
1515

1616
type = this.gettype(str);
17+
18+
// Comment out the entire switch if you want JS-like
19+
// behavior instead of PHP behavior
1720
switch (type) {
1821
case 'boolean':
1922
if (str === true) {

0 commit comments

Comments
 (0)