The concept of functions being objects in JavaScript would be ok with me if I could understand the following question. I have searched around and looked into the javascript engine to try and find the answer, but no explanation I've found so far sits well in my mind...
An object like the one below is understandably layed out in a hash map type of construct.
var person = {
    firstName:"John",
    lastName:"Doe",
    age:50,
    eyeColor:"blue"
};
However, to say this is also an object is where I get stuck:
var name = function () {
    alert ('name');
}
- In terms of memory, how is this function stored? 
- Are the statements inside the "hash map" of a function layed out in an execute order? So each property is called upon after the other? 
I'm probably missing something or visualising something wrong.
Thanks.
P.S
To clear up question 2,
Say I have an if statement inside my function... will that be stored in a property accessible through one of its properties?
{ ... }the same way in both cases? That might be misleading you. The syntax of a function body is entirely different than an object literal; they just happen to use the same outer delimiter.