JSFiddle - React, Tailwind, and code Playground

HTML

<form action="">
  <input type="checkbox" value="1">
  <input type="checkbox" value="0">
  <input type="checkbox" value="1">
  <input type="checkbox" value="0">
  <input type="checkbox" value="1">
  <input type="checkbox" value="0">
</form>

JavaScript

$('form').find(':checkbox').each(function(){
  if ($(this).val() != 0) {
    $(this).prop('checked', true)
  }
})