code: function parseMargins(margins = '0px') {
      // Use regular expression in order to properly
      // handle multiple spaces in-between of tokens: '0px     2px   5px'.
      //
      // Casting to a string is required to keep the behavior
      // closer to the native implementation which converts
      // an array like [[['2px 3px']]] to '2px 3px';
      margins = (margins + '').split(/\s+/);
  
      // Chrome validates tokens length starting from version 53.
      if (margins.length > 4) {
          throw new Error('Extra text found at the end of rootMargin.');
      }
  
      margins[0] = margins[0] || '0px';
      margins[1] = margins[1] || margins[0];
      margins[2] = margins[2] || margins[0];
      margins[3] = margins[3] || margins[1];
  
      const rawData = margins.join(' ');
  
      const parsedData = margins.map(token => {
          let [,value, unit] = /^(-?\d*\.?\d+)(px|%)$/.exec(token) || [];
          const pixels = unit === 'px';
  
          value = parseFloat(value);
  
          if (!window.isFinite(value)) {
              throw new Error('rootMargin must be specified in pixels or percent.');
          }
  
          if (!pixels) {
              value /= 100;
          }
  
          return {value, pixels};
      });
  
      return {rawData, parsedData};
  }
docs: Validates and converts margins value (defined in a form of
  CSS 'margin' property) to a list of tokens, e.g:
  1. '0px' = [['0px'], ['0px'], ['0px'], ['0px']]
  2. '5px 11px' = [['5px'], ['11px'], ['5px'], ['11px']]
  
  @param {String} [margins = '0px'] - Margins value to be processed.
  @returns {Array<Array>} Object that contains both: a list of
  tokens and its string representation.