Мои решения:
function tytPreGetBool(pre) { return localStorage.getItem(pre) == 'true' ? true : false; }