JSFiddle - React, Tailwind, and code Playground

JavaScript

class App {
  constructor(props) {
    this.state = {
      isOpened: false
    };
  };
  handlerClick(event) {
    function rangeEnd(thisPage) {
    	let totalPages;
      console.log(this)
      let end = thisPage + 2;
      return (end <= totalPages) ? end : thisPage;
    }
    rangeEnd.bind(this)(5)
  }
}

let a = new App();
a.handlerClick(null);