By jonathan


2009-07-24 18:30:45 8 Comments

Can anyone verify this for me? JavaScript does not have a version of strcmp(), so you have to write out something like:

 ( str1 < str2 ) ? 
            -1 : 
             ( str1 > str2 ? 1 : 0 );

Related Questions

Sponsored Content

97 Answered Questions

[SOLVED] How can I remove a specific item from an array?

  • 2011-04-23 22:17:18
  • Walker
  • 7141704 View
  • 8657 Score
  • 97 Answer
  • Tags:   javascript arrays

63 Answered Questions

[SOLVED] How can I merge properties of two JavaScript objects dynamically?

46 Answered Questions

[SOLVED] How do I remove a property from a JavaScript object?

86 Answered Questions

[SOLVED] How do JavaScript closures work?

61 Answered Questions

[SOLVED] How do I include a JavaScript file in another JavaScript file?

94 Answered Questions

[SOLVED] How do I make the first letter of a string uppercase in JavaScript?

28 Answered Questions

[SOLVED] What does "use strict" do in JavaScript, and what is the reasoning behind it?

27 Answered Questions

3 Answered Questions

Sponsored Content