Minor ES6 improvements
Change-Id: Ibf956915d1b7769dc5cc22a870f4484f492da723
diff --git a/dev/js/src/menu.js b/dev/js/src/menu.js
index 9f3cf75..1685da5 100644
--- a/dev/js/src/menu.js
+++ b/dev/js/src/menu.js
@@ -222,12 +222,14 @@
var prefix = " " + prefixList[pref];
// Check if it matches at the beginning
- if ((this.item(pos).lcField().indexOf(prefix)) >= 0) {
+ // if ((this.item(pos).lcField().indexOf(prefix)) >= 0) {
+ if ((this.item(pos).lcField().includes(prefix))) {
points += 5;
}
// Check if it matches anywhere
- else if ((this.item(pos).lcField().indexOf(prefix.substring(1))) >= 0) {
+ // else if ((this.item(pos).lcField().indexOf(prefix.substring(1))) >= 0) {
+ else if ((this.item(pos).lcField().includes(prefix.substring(1)))) {
points += 1;
};
};