How to differentiate between factory objects and functions?
<p>I learnt that one way objects could be created in JavaScript (factory function) is as follows:</p>

<pre><code>var newPerson=function(name){  
    var result = new Object();  
    result.name = name;  
    result.getName = function(){  
        return this.name;  
    };  
    return result;  
}; 


var personOne = newPerson("Diego");  
var personTwo = newPerson("Gangelo");  

console.log(personOne.getName()); // prints Diego  
console.log(personTwo.getName()); // prints Gangelo
</code></pre>

<p>Well, I found somewhere that a function could be created as follows:</p>

<pre><code>var hello = new Function('alert("Hello, World!");');
</code></pre>

<p>So how could I know an object from a function if they're declared in the same manner?</p>
