String.prototype.equals = function(str){return this == str;}
function equals(str1, str2){
if(str1 == str2){
return true;
}
return false;
}
str1和str2是String的两个实例
var str1 = "qwe";
var str2 = "qwe22";
console.dir(str1.equals(str2));
String.prototype.equals = function(str){return this == str;}
function equals(str1, str2){
if(str1 == str2){
return true;
}
return false;
}
str1和str2是String的两个实例
var str1 = "qwe";
var str2 = "qwe22";
console.dir(str1.equals(str2));