Your question is a little unclear, but I think something like this is what you are looking for:
function funcName(first_data, SECOND_DATA_KEY, SECOND_DATA_VALUE) {
// ...some code here...
x = {}
x.data = {dontMatterProp: dontMatterVal}
x.data[SECOND_DATA_KEY] = SECOND_DATA_VALUE
// ...some code.....
}
If you just want the key to be equal to the value, you could just do
x.data[SECOND_DATA] = SECOND_DATA
But that's a little odd. Why map something to itself? No value necessary, you can just verify that the key exists if that's the case...
You can use brackets for dynamic keys in javascript. So,
var x = {}
x['something'] = 'test'
// x === { 'something': 'test' }
x[something] = 'test2'
// error: something is undefined
var something = 'hello'
x[something] = 'test3'
// x === { 'something': 'test', 'hello': 'test3' }
Hope that helps?
data[SECOND_DATA] = SECOND_DATA;