-1
タイトルのアルファベット順を並べ替えようとしていますが、タイトルの最初の単語が "the"という単語を無視しています。私はjavascript、ライブラリなしでそれを行う必要があります。javascriptの使用sort(); "The"を無視しています。
console.log(books.sort());
返すために起こっている:
["Crime and Punishment", "Hamlet", "Heart of Darkness", "Moby Dick", "Pride and Prejudice", "The Brothers Karamazov", "The Catcher in the Rye", "The Great Gatsby", "The Iliad", "The Odyssey"]
を最初の3文字の場合を無視して、私は並べ替えることができますどのように知っていただきたいと思いますしかし、私は実行するのであれば、今
// Sample Array
var books = ['Moby Dick', 'Hamlet', 'The Odyssey', 'The Great Gatsby', 'The Brothers Karamazov', 'The Iliad', 'Crime and Punishment', 'Pride and Prejudice', 'The Catcher in the Rye', 'Heart of Darkness'];
タイトルは「The」で始まるので、返されます。
["The Brothers Karamazov", "The Catcher in the Rye", "Crime and Punishment", "The Great Gatsby", "Hamlet", "Heart of Darkness", "The Iliad", "Moby Dick", "The Odyssey", "Pride and Prejudice"]
重複http://stackoverflow.com/q/34347008/1028949 – Quantastical