diff --git a/core/misc/states.es6.js b/core/misc/states.es6.js
index ec7a4e7e3a..c22c766d9d 100644
--- a/core/misc/states.es6.js
+++ b/core/misc/states.es6.js
@@ -33,20 +33,19 @@
   Drupal.behaviors.states = {
     attach(context, settings) {
       const $states = $(context).find('[data-drupal-states]');
-      let config;
-      let state;
+      const createState = (i, state, config) => {
+        new states.Dependent({
+          element: $($states[i]),
+          state: states.State.sanitize(state),
+          constraints: config[state],
+        });
+      };
       const il = $states.length;
       for (let i = 0; i < il; i++) {
-        config = JSON.parse($states[i].getAttribute('data-drupal-states'));
-        for (state in config) {
-          if (config.hasOwnProperty(state)) {
-            new states.Dependent({
-              element: $($states[i]),
-              state: states.State.sanitize(state),
-              constraints: config[state],
-            });
-          }
-        }
+        const config = JSON.parse($states[i].getAttribute('data-drupal-states'));
+        Object.keys(config).forEach((state) => {
+          createState(i, state, config);
+        });
       }
 
       // Execute all postponed functions now.
@@ -126,37 +125,30 @@
      *   dependee's compliance status.
      */
     initializeDependee(selector, dependeeStates) {
-      let state;
-      const self = this;
-
-      function stateEventHandler(e) {
-        self.update(e.data.selector, e.data.state, e.value);
-      }
-
       // Cache for the states of this dependee.
       this.values[selector] = {};
 
-      for (const i in dependeeStates) {
-        if (dependeeStates.hasOwnProperty(i)) {
-          state = dependeeStates[i];
-          // Make sure we're not initializing this selector/state combination
-          // twice.
-          if ($.inArray(state, dependeeStates) === -1) {
-            continue;
-          }
+      Object.keys(dependeeStates).forEach((i) => {
+        let state = dependeeStates[i];
+        // Make sure we're not initializing this selector/state combination
+        // twice.
+        if ($.inArray(state, dependeeStates) === -1) {
+          return;
+        }
 
-          state = states.State.sanitize(state);
+        state = states.State.sanitize(state);
 
-          // Initialize the value of this state.
-          this.values[selector][state.name] = null;
+        // Initialize the value of this state.
+        this.values[selector][state.name] = null;
 
-          // Monitor state changes of the specified state for this dependee.
-          $(selector).on(`state:${state}`, { selector, state }, stateEventHandler);
+        // Monitor state changes of the specified state for this dependee.
+        $(selector).on(`state:${state}`, { selector, state }, (e) => {
+          this.update(e.data.selector, e.data.state, e.value);
+        });
 
-          // Make sure the event we just bound ourselves to is actually fired.
-          new states.Trigger({ selector, state });
-        }
-      }
+        // Make sure the event we just bound ourselves to is actually fired.
+        new states.Trigger({ selector, state });
+      });
     },
 
     /**
diff --git a/core/misc/states.js b/core/misc/states.js
index 2b9d3b886a..eed426d67e 100644
--- a/core/misc/states.js
+++ b/core/misc/states.js
@@ -15,20 +15,24 @@
   Drupal.behaviors.states = {
     attach: function attach(context, settings) {
       var $states = $(context).find('[data-drupal-states]');
-      var config = void 0;
-      var state = void 0;
+      var createState = function createState(i, state, config) {
+        new states.Dependent({
+          element: $($states[i]),
+          state: states.State.sanitize(state),
+          constraints: config[state]
+        });
+      };
       var il = $states.length;
+
+      var _loop = function _loop(i) {
+        var config = JSON.parse($states[i].getAttribute('data-drupal-states'));
+        Object.keys(config).forEach(function (state) {
+          createState(i, state, config);
+        });
+      };
+
       for (var i = 0; i < il; i++) {
-        config = JSON.parse($states[i].getAttribute('data-drupal-states'));
-        for (state in config) {
-          if (config.hasOwnProperty(state)) {
-            new states.Dependent({
-              element: $($states[i]),
-              state: states.State.sanitize(state),
-              constraints: config[state]
-            });
-          }
-        }
+        _loop(i);
       }
 
       while (states.postponed.length) {
@@ -62,32 +66,27 @@
 
   states.Dependent.prototype = {
     initializeDependee: function initializeDependee(selector, dependeeStates) {
-      var state = void 0;
-      var self = this;
-
-      function stateEventHandler(e) {
-        self.update(e.data.selector, e.data.state, e.value);
-      }
+      var _this = this;
 
       this.values[selector] = {};
 
-      for (var i in dependeeStates) {
-        if (dependeeStates.hasOwnProperty(i)) {
-          state = dependeeStates[i];
+      Object.keys(dependeeStates).forEach(function (i) {
+        var state = dependeeStates[i];
 
-          if ($.inArray(state, dependeeStates) === -1) {
-            continue;
-          }
+        if ($.inArray(state, dependeeStates) === -1) {
+          return;
+        }
 
-          state = states.State.sanitize(state);
+        state = states.State.sanitize(state);
 
-          this.values[selector][state.name] = null;
+        _this.values[selector][state.name] = null;
 
-          $(selector).on('state:' + state, { selector: selector, state: state }, stateEventHandler);
+        $(selector).on('state:' + state, { selector: selector, state: state }, function (e) {
+          _this.update(e.data.selector, e.data.state, e.value);
+        });
 
-          new states.Trigger({ selector: selector, state: state });
-        }
-      }
+        new states.Trigger({ selector: selector, state: state });
+      });
     },
     compare: function compare(reference, selector, state) {
       var value = this.values[selector][state.name];
diff --git a/core/modules/color/color.es6.js b/core/modules/color/color.es6.js
index 5a514e564c..9c5863002a 100644
--- a/core/modules/color/color.es6.js
+++ b/core/modules/color/color.es6.js
@@ -14,9 +14,6 @@
    */
   Drupal.behaviors.color = {
     attach(context, settings) {
-      let i;
-      let j;
-      let colors;
       // This behavior attaches by ID, so is only valid once on a page.
       const form = $(context).find('#system-theme-settings .color-form').once('color');
       if (form.length === 0) {
@@ -33,34 +30,30 @@
 
       // Decode reference colors to HSL.
       const reference = settings.color.reference;
-      for (i in reference) {
-        if (reference.hasOwnProperty(i)) {
-          reference[i] = farb.RGBToHSL(farb.unpack(reference[i]));
-        }
-      }
+      Object.keys(reference).forEach((i) => {
+        reference[i] = farb.RGBToHSL(farb.unpack(reference[i]));
+      });
 
       // Build a preview.
       const height = [];
       const width = [];
       // Loop through all defined gradients.
-      for (i in settings.gradients) {
-        if (settings.gradients.hasOwnProperty(i)) {
-          // Add element to display the gradient.
-          $('.color-preview').once('color').append(`<div id="gradient-${i}"></div>`);
-          const gradient = $(`.color-preview #gradient-${i}`);
-          // Add height of current gradient to the list (divided by 10).
-          height.push(parseInt(gradient.css('height'), 10) / 10);
-          // Add width of current gradient to the list (divided by 10).
-          width.push(parseInt(gradient.css('width'), 10) / 10);
-          // Add rows (or columns for horizontal gradients).
-          // Each gradient line should have a height (or width for horizontal
-          // gradients) of 10px (because we divided the height/width by 10
-          // above).
-          for (j = 0; j < (settings.gradients[i].direction === 'vertical' ? height[i] : width[i]); ++j) {
-            gradient.append('<div class="gradient-line"></div>');
-          }
+      Object.keys(settings.gradients).forEach((i) => {
+        // Add element to display the gradient.
+        $('.color-preview').once('color').append(`<div id="gradient-${i}"></div>`);
+        const gradient = $(`.color-preview #gradient-${i}`);
+        // Add height of current gradient to the list (divided by 10).
+        height.push(parseInt(gradient.css('height'), 10) / 10);
+        // Add width of current gradient to the list (divided by 10).
+        width.push(parseInt(gradient.css('width'), 10) / 10);
+        // Add rows (or columns for horizontal gradients).
+        // Each gradient line should have a height (or width for horizontal
+        // gradients) of 10px (because we divided the height/width by 10
+        // above).
+        for (let j = 0; j < (settings.gradients[i].direction === 'vertical' ? height[i] : width[i]); ++j) {
+          gradient.append('<div class="gradient-line"></div>');
         }
-      }
+      });
 
       // Set up colorScheme selector.
       form.find('#edit-scheme').on('change', function () {
@@ -68,12 +61,10 @@
         const colorScheme = this.options[this.selectedIndex].value;
         if (colorScheme !== '' && schemes[colorScheme]) {
           // Get colors of active scheme.
-          colors = schemes[colorScheme];
-          for (const fieldName in colors) {
-            if (colors.hasOwnProperty(fieldName)) {
-              callback($(`#edit-palette-${fieldName}`), colors[fieldName], false, true);
-            }
-          }
+          const colors = schemes[colorScheme];
+          Object.keys(colors).forEach((fieldName) => {
+            callback($(`#edit-palette-${fieldName}`), colors[fieldName], false, true);
+          });
           preview();
         }
       });
@@ -160,6 +151,8 @@
        */
       function callback(input, color, propagate, colorScheme) {
         let matched;
+        let i;
+        let j;
         // Set background/foreground colors.
         $(input).css({
           backgroundColor: color,
diff --git a/core/modules/color/color.js b/core/modules/color/color.js
index 1b036c3aa1..9c6f139639 100644
--- a/core/modules/color/color.js
+++ b/core/modules/color/color.js
@@ -8,10 +8,6 @@
 (function ($, Drupal) {
   Drupal.behaviors.color = {
     attach: function attach(context, settings) {
-      var i = void 0;
-      var j = void 0;
-      var colors = void 0;
-
       var form = $(context).find('#system-theme-settings .color-form').once('color');
       if (form.length === 0) {
         return;
@@ -25,40 +21,34 @@
       var farb = $.farbtastic('.color-placeholder');
 
       var reference = settings.color.reference;
-      for (i in reference) {
-        if (reference.hasOwnProperty(i)) {
-          reference[i] = farb.RGBToHSL(farb.unpack(reference[i]));
-        }
-      }
+      Object.keys(reference).forEach(function (i) {
+        reference[i] = farb.RGBToHSL(farb.unpack(reference[i]));
+      });
 
       var height = [];
       var width = [];
 
-      for (i in settings.gradients) {
-        if (settings.gradients.hasOwnProperty(i)) {
-          $('.color-preview').once('color').append('<div id="gradient-' + i + '"></div>');
-          var gradient = $('.color-preview #gradient-' + i);
+      Object.keys(settings.gradients).forEach(function (i) {
+        $('.color-preview').once('color').append('<div id="gradient-' + i + '"></div>');
+        var gradient = $('.color-preview #gradient-' + i);
 
-          height.push(parseInt(gradient.css('height'), 10) / 10);
+        height.push(parseInt(gradient.css('height'), 10) / 10);
 
-          width.push(parseInt(gradient.css('width'), 10) / 10);
+        width.push(parseInt(gradient.css('width'), 10) / 10);
 
-          for (j = 0; j < (settings.gradients[i].direction === 'vertical' ? height[i] : width[i]); ++j) {
-            gradient.append('<div class="gradient-line"></div>');
-          }
+        for (var j = 0; j < (settings.gradients[i].direction === 'vertical' ? height[i] : width[i]); ++j) {
+          gradient.append('<div class="gradient-line"></div>');
         }
-      }
+      });
 
       form.find('#edit-scheme').on('change', function () {
         var schemes = settings.color.schemes;
         var colorScheme = this.options[this.selectedIndex].value;
         if (colorScheme !== '' && schemes[colorScheme]) {
-          colors = schemes[colorScheme];
-          for (var fieldName in colors) {
-            if (colors.hasOwnProperty(fieldName)) {
-              callback($('#edit-palette-' + fieldName), colors[fieldName], false, true);
-            }
-          }
+          var colors = schemes[colorScheme];
+          Object.keys(colors).forEach(function (fieldName) {
+            callback($('#edit-palette-' + fieldName), colors[fieldName], false, true);
+          });
           preview();
         }
       });
@@ -101,6 +91,8 @@
 
       function callback(input, color, propagate, colorScheme) {
         var matched = void 0;
+        var i = void 0;
+        var j = void 0;
 
         $(input).css({
           backgroundColor: color,
diff --git a/core/modules/editor/js/editor.admin.es6.js b/core/modules/editor/js/editor.admin.es6.js
index b02fe8bc44..5fb907f51f 100644
--- a/core/modules/editor/js/editor.admin.es6.js
+++ b/core/modules/editor/js/editor.admin.es6.js
@@ -567,16 +567,12 @@
       // If any filter's current status forbids the editor feature, return
       // false.
       Drupal.filterConfiguration.update();
-      for (const filterID in Drupal.filterConfiguration.statuses) {
-        if (Drupal.filterConfiguration.statuses.hasOwnProperty(filterID)) {
+      const disallowedFeature = Object.keys(Drupal.filterConfiguration.statuses)
+        .some((filterID) => {
           const filterStatus = Drupal.filterConfiguration.statuses[filterID];
-          if (!(filterStatusAllowsFeature(filterStatus, feature))) {
-            return false;
-          }
-        }
-      }
-
-      return true;
+          return !filterStatusAllowsFeature(filterStatus, feature);
+        });
+      return !disallowedFeature;
     },
   };
 
diff --git a/core/modules/editor/js/editor.admin.js b/core/modules/editor/js/editor.admin.js
index 377aef2324..5cc6948477 100644
--- a/core/modules/editor/js/editor.admin.js
+++ b/core/modules/editor/js/editor.admin.js
@@ -256,16 +256,11 @@
       }
 
       Drupal.filterConfiguration.update();
-      for (var filterID in Drupal.filterConfiguration.statuses) {
-        if (Drupal.filterConfiguration.statuses.hasOwnProperty(filterID)) {
-          var filterStatus = Drupal.filterConfiguration.statuses[filterID];
-          if (!filterStatusAllowsFeature(filterStatus, feature)) {
-            return false;
-          }
-        }
-      }
-
-      return true;
+      var disallowedFeature = Object.keys(Drupal.filterConfiguration.statuses).some(function (filterID) {
+        var filterStatus = Drupal.filterConfiguration.statuses[filterID];
+        return !filterStatusAllowsFeature(filterStatus, feature);
+      });
+      return !disallowedFeature;
     }
   };
 
