I am not sure how I can pass a variable from my JS folder to my Twig templates. It is a variable that takes true/false on page load and needs to be used inside an If statement to execute responsive code.
I tried calling the name of the variable itself but as I found out that doesn't work.
JS Script
var isMobile = (function() {....})();
Twig template
{% if isMobile %}
<div>Small div</div>
{% else %}
<div>Big div</div>
{% endif %}