Skip to content

Commit b82272a

Browse files
committed
refactor: implementing XOs suggestion
unicorn/no-typeof-undefined
1 parent b0fd68c commit b82272a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

datalist-polyfill.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
obs;
6969

7070
// Define a new observer
71-
if (typeof MutationObserver !== 'undefined') {
71+
if (MutationObserver !== undefined) {
7272
obs = new MutationObserver(function (mutations) {
7373
var datalistNeedsAnUpdate = false;
7474

@@ -370,7 +370,7 @@
370370

371371
// Function for preparing and sorting the options/suggestions
372372
var prepOptions = function (datalist, input) {
373-
if (typeof obs !== 'undefined') {
373+
if (obs !== undefined) {
374374
obs.disconnect();
375375
}
376376

@@ -448,7 +448,7 @@
448448
disabledValues
449449
);
450450

451-
if (typeof obs !== 'undefined') {
451+
if (obs !== undefined) {
452452
obs.observe(datalist, {
453453
childList: true,
454454
});

0 commit comments

Comments
 (0)