title: How to pass bool value from viewbag to jQuery side?
body: <p>I stuck with problem of passing viewbag value from server side to front-end side jQuery, previous examples did not work for me:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>var test = '@ViewBag.IsReviewLast'.toString().ToLower();
  console.log(test);</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>var myValue = $('#' + '@(ViewBag.IsReviewLast)').val();</code></pre>
  </div>
  </div>
  
  It`s just return a "ViewBag.IsReviewLast" string value.</p>
  
  <p>There is should be my simple logic:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>$(document).ready(function () {
      var test = '@ViewBag.IsReviewLast'.toString().ToLower();
      if (test) {
          //some logic
      }
  });
  
  [enter image description here][1]</code></pre>
  </div>
  </div>
  </p>
  
  <p>Without brakets it`s also not working.</p>