Skip to content

Commit bf77b77

Browse files
author
Brian Vaughn
committed
Replaced TfIdfSearchIndex inline function.bind with arrow function
1 parent 798af4c commit bf77b77

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/SearchIndex/TfIdfSearchIndex.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ export class TfIdfSearchIndex implements ISearchIndex {
103103
}
104104

105105
// 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));
106+
return documents.sort((documentA, documentB) =>
107+
this._calculateTfIdf(tokens, documentB, corpus) -
108+
this._calculateTfIdf(tokens, documentA, corpus)
109+
);
110110
}
111111

112112
/**

0 commit comments

Comments
 (0)