main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var Darth_Vader = {
    // properties
    first_name:         "Anakin",
    last_name:          "Skywalker",
    teacher:            ["Obi-Wan Kenobi", "Darth Sidius"],
    student:            ["Galen Marek"],
    child:              ["Luke","Leia"],
    affiliation:        "Empire",

    // methods
    fullName : function(x) {
       return this.first_name + " " + this.last_name;
    }
};

console.log( Darth_Vader.affiliation );
console.log( Darth_Vader.fullName() );
for ( i = 0; i < Darth_Vader.child.length; i++) {
    console.log( Darth_Vader.child[i] );
}
Native Browser JavaScript