Compare one string to another - Node.js String

Node.js examples for String:String Value

Description

Compare one string to another

Demo Code

String.prototype.compareTo = function(other) {
  if (this < other)
    return -1;// w w  w .j a v  a 2s  .c  om
  if (other < this)
    return 1;
  return 0;
}

Related Tutorials