how to add properties to an object in javascript inside a function object code example
Example 1: javascript dynamically access object property
var person ={"first_name":"Billy","last_name":"Riley"};
var property_name="first_name";
alert(person[property_name]); //Dynamically access object property with bracket notation
Example 2: js create object with properties
var mycar = new Car('Eagle', 'Talon TSi', 1993);