SyntaxFix
Write A Post
Hire A Developer
Questions
How about:
String.prototype.strcmp = function(s) { if (this < s) return -1; if (this > s) return 1; return 0; }
Then, to compare s1 with 2:
s1.strcmp(s2)