Hey,
goog.isString = function(val) { return typeof val == 'string'; };
var b = new String("I am also a string!"); alert(goog.isString(b)); // Will output FALSE
If that doesn't scream ignorance of the language, what does?
goog.isString = function(val) { return typeof val == 'string'; };
var b = new String("I am also a string!"); alert(goog.isString(b)); // Will output FALSE
If that doesn't scream ignorance of the language, what does?
dojo.isString = function(/*anything*/ it){
// summary:
// Return true if it is a String
return (typeof it == "string" || it instanceof String); // Boolean
}So the Google function correctly returns whether String(foo) is a no-op.