If you pass the function as a callback, you will get the current value.
$("#check1").prop("checked", function(i, value) { return !value; });
.prop( propertyName, function(index, oldPropertyValue) )
propertyNameThe name of the property to set.function(index, oldPropertyValue) A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.
link
source share