If We have
var randomname = {};
randomname.attribute = \'something\';
function randomname(){
alert(randomname.attribute);
}
randomname();
forgive my pedant reply. your question is a bit confusing, or is this a tricky question. In the second line you wrote
var randomname.attribute....
if thats your point, then it is an illegal statement and will definitely throw an exception. But if your point is about the fourth line where you reused the same name.
note that you wrote
function randomname(){...}
instead of
var randomname = function(){...}
I dont know why, but because you used a future function, you wont be able to override preexisting names. therefore randomname will still be a hash instead of a function, thus throwing an exception.
My question is, so what will happen to randomname function? How can we call it? Is it a wasted resource? As a general rule I always use
var randomname = function{..}
template so I am always assured that name conflicts wont happen so I never encounter this.