title: Add value only once
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let kod = "";
  $(".radOvladac").click(function(){
  if($(this).is(':checked')){
    let value = $(this).val();
    kod = kod  + value;
    console.log(kod);
  }
  
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="ovladani"&gt;
  
                  &lt;input type="checkbox" value="-y1" class="regulaceTeploty"&gt;
                  &lt;h2&gt;Tempeture regulation&lt;/h2&gt;
                    &lt;input type="checkbox" value="-a" class="radOvladac"&gt;Heater&lt;br&gt;
                    &lt;input type="checkbox" value="-b" class="radOvladac"&gt;Ground heater 1&lt;br&gt;
                    &lt;input type="checkbox" value="-c" class="radOvladac"&gt;Ground heater 2&lt;br&gt;
                    &lt;input type="checkbox" value="-d" class="radOvladac"&gt;Funcoil&lt;br&gt;
  
                &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have multiple checkboxes (around 20)</p>
  
  <pre><code>&lt;input type="checkbox" value="-a" class="Configurator"&gt;Radiátory&lt;br&gt;
  &lt;input type="checkbox" value="-b" class="Configurator"&gt;Podlahové vodní&lt;br&gt;
  &lt;input type="checkbox" value="-c" class="Configurator"&gt;Podlahové el.&lt;br&gt;
  &lt;input type="checkbox" value="-d" class="Configurator"&gt;Funcoil&lt;br&gt;
  </code></pre>
  
  <p>If i check any, adds .val(); as string inside variable "kod" (code)</p>
  
  <pre><code>$(".radOvladac").click(function(){
  if($(this).is(':checked')){
    let value = "";
    kod = kod + value;
    value = $(this).val();
    kod = kod + value;
    console.log(kod);
  }
  </code></pre>
  
  <p>It adds up its value like "-a-a-a-a-b..." How can i toggle this value only once? Kod is global variable that cant be changed. If i check checkbox, it adds -a -> if i uncheck, it deletes -a and so on. I have been using -split, however that would be complicated.</p>