Building on Steven's answer above, I wrote this function as a generic parser for string input:
parse:
function (value) {
switch (value && value.toLowerCase()) {
case null: return null;
case "true": return true;
case "false": return false;
default: try { return parseFloat(value); } catch (e) { return value; }
}
}