how about returning the value rather than true?

Instead of...

if (checkNested(obj, string)) {
 thing = string;
}

you could use

var thing = checkNested(obj, string) || defaultValue