Shouldn't the undefined check be like this?
if (typeof fruit === "undefined") {
fruit = "strawberry";
}
Unless your doing something like: (function(undefined) {
})();