The behaviour can be seen in this little snippet (execute it as a global script):
var name = {}; name.FirstName = \'Tom\'; alert(name.FirstName);
With ES6+, you could write your code as let name or const name. This won't assign it or try to override window.name. More on that here.
let name
const name
window.name
let name = {}; name.FirstName = 'Tom'; alert(name.FirstName);