property myProperty is not assigned to variable foo, foo is an object.
var foo=null;//null is an object
foo.myProperty = "my value";
console.log(typeof foo.myProperty);
property myProperty is not assigned to variable foo, foo is an object.
var foo=null;//null is an object
foo.myProperty = "my value";
console.log(typeof foo.myProperty);
A Javascript object should be declared like this
var myObject = {};
Try to modify you code like
var foo = {};
foo.myProperty = "a string";
console.log(typeof foo.myProperty);