It's not clear what "this" is in this context! But assuming the following object:
params = {
This_year: "1/1/14",
keyA : "valueA",
keyB : "valueB"
};
If you assign a value to params, you're basically overwriting it, for example:
params = null;
params.hasOwnProperty("This_year") will return false!
I wonder why you say "make X different", so I'll assume you mean, change existent key value:
params = {
This_year: "1/1/14",
Last_year: "xxxx"
};
params.Last_year = "YYYY";
So, you can set a property with a value on the parameters object, as in:
var params = { This_year: "1/1/14" };
if (params.hasOwnProperty("This_year") && params.This_year === "1/1/14") {
params["Last_year"] = "2013";
}
I would recommend to normalize the date, so you don't have to hard type:
if (params.hasOwnProperty("This_year") && params.This_year === "1/1/2014") {
params.Last_year = ( new Date("1/1/14").getFullYear() - 1);
}
Since "1/1/14" would return year 1914 and "1/1/2014" return 2014.
Hope this helps!