Convert undefined to false JSON.parse(someVariable || false) Returns "true" => true "false" => false undefined => false Retain undefined as undefined someVariable && JSON.parse(someVariable) Returns "true" => true "false" => false undefined => undefined