.val(value) does not work on checkboxes if value is not an array

.val(value) does not work on checkboxes if value is not an array

The documentation states that .val(value) should accept, and work with, String, Number, or Array.  However, with checkboxes it doesn't work with String, but it does work with an Array of Strings.  As a work-around, I am wrapping my String with [] (brackets), which appears to be working.  Here is an example of what doesn't work:

  1. $("#LabelEditModalForm-AdminUseOnly").val($data.data("adminuseonly"));
    
    

and this does work:

  1. $("#LabelEditModalForm-AdminUseOnly").val([ $data.data("adminuseonly") ]);
    
    

NOTE: I haven't tried using numbers.