We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfe0a24 commit cd22619Copy full SHA for cd22619
functions/var/strval.js
@@ -3,17 +3,20 @@ function strval (str) {
3
// + original by: Brett Zamir (http://brett-zamir.me)
4
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
5
// + 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
7
// - depends on: gettype
8
// * example 1: strval({red: 1, green: 2, blue: 3, white: 4});
9
- // * returns 1: 'Array'
+ // * returns 1: 'Object'
+
10
var type = '';
11
12
if (str === null) {
13
return '';
14
}
15
16
type = this.gettype(str);
17
18
+ // Comment out the entire switch if you want JS-like
19
+ // behavior instead of PHP behavior
20
switch (type) {
21
case 'boolean':
22
if (str === true) {
0 commit comments