Every object has a prototype, when you use . to get one object's property.
Firstly, it will find the properties of itself, if do not get the target property, it will find its prototype's properties, if still do not get the target property, it will continue to find properties of its proertype's propertype. After these, this case get easy.
After using new, you get a instance myFuncInstance, when using myFuncInstance.foo , beacause itself do not have a property called foo, it will get the property foo from its constructor myFunction's prototype.
However, when using myFunction.foo, myFunction alse do not have a property call foo, it will find its prototype Function.prototype, it also can not find foo, so find the Function.prototype's prototype Object.prototype, it still can not find, so find the Object.prototype's prototype null, all of the prototype chain can not find foo, so it is undefined.