Skip to content

Commit e37e744

Browse files
committed
Prefer String.includes() over String.indexOf()
For simple inclusion checks, String.includes() is more explicit and reads a little bit nicer. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
1 parent 062a933 commit e37e744

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

debug_toolbar/static/debug_toolbar/js/toolbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ const djdt = {
240240
},
241241
cookie: {
242242
get: function (key) {
243-
if (document.cookie.indexOf(key) === -1) {
243+
if (!document.cookie.includes(key)) {
244244
return null;
245245
}
246246

0 commit comments

Comments
 (0)