We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 798af4c commit bf77b77Copy full SHA for bf77b77
source/SearchIndex/TfIdfSearchIndex.js
@@ -103,10 +103,10 @@ export class TfIdfSearchIndex implements ISearchIndex {
103
}
104
105
// Return documents sorted by TF-IDF
106
- return documents.sort(function (documentA, documentB) {
107
- return this._calculateTfIdf(tokens, documentB, corpus) -
108
- this._calculateTfIdf(tokens, documentA, corpus);
109
- }.bind(this));
+ return documents.sort((documentA, documentB) =>
+ this._calculateTfIdf(tokens, documentB, corpus) -
+ this._calculateTfIdf(tokens, documentA, corpus)
+ );
110
111
112
/**
0 commit comments