<label>
  <input type="checkbox" id="check">
  тот самый чекбокс
</label>

<div>
  <button>Что в переменной?</button>
  <output></output>
</div>
div {
  margin: 20px 0;
}
/**
 * для вопроса https://qna.habr.com/q/1254146
 * Как сделать, чтобы в переменную передавалась информация активен ли чекбокс или нет?
 */

let variable = false;

document.getElementById('check')
  .addEventListener('change', ({ target }) => {
    variable = !!target.checked;
  });

// демо
const output = document.querySelector('output');
document.querySelector('button')
  .addEventListener('click', () => {
    output.innerText = String(variable);
  });

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.