title: Update variable data with the help of object key on window resize
body: <p>Recently I am trying to create slider like swiperjs.
  Here is my code</p>
  <pre><code>let config = {
      perItem: 4,
      breakpoints: {
          992: {
              perItem: 3
          }
          768: {
              perItem: 2
          }
      }
  }
  let perItem = config.perItem
  </code></pre>
  <p>But I stuck in breakpoints. I wanna update perItem according to breakpoints.
  how to achieve this in pure javascript.</p>