Is there a better way to improve the below statement to check if the val() is 'true' or 'false' and if it is then it will change it to a Boolean. The reason being, some of the values may be a word.
var thisval = $(this).val();
if (thisval == "true"){
ao[id] = true;
} else if (thisval == "false"){
ao[id] = false;
} else {
ao[id] = $(this).val();
}