I have this code:
sw = {}
sw.photoswipe = {
  settings: {
    screenWidths:  [1024, 1280, 1440, 1680, 1920, 2560, 2880, 3840],
    screenHeights: [ 768,  800,  900, 1050, 1200, 1600, 1800, 2400],
    _pixelRatio:   window.devicePixelRatio || 1,
    // this line is where the error happens
    _screenWidth:  window.screen.width * _pixelRatio,
    _screenHeight: window.screen.height * _pixelRatio,
    getScreenSizeDescription: function() {
      return _screenWidth.toString() + 'x' + _screenHeight;
    },
    ...
  }
}
Error I am getting is:
12:37:09.471 ReferenceError: _pixelRatio is not defined 1
It's defined right above. Why the error? Please explain.
 
    