Okay, so I've got some legacy code that constructs JSON objects by hand (makes the string).
var stringJSON = '{ "person": "'+userName+'", "code": "'+password+'" }';
request.write(stringJSON);
But I have since realized that this would work just the same by using object declaration.
var jsObject = { "person": userName, "code": password };
request.write(JSON.stringify(jsObject));
I mean it looks like the first way will be...trivially faster. But the actual javascript object declaration way feels cleaner. Is there any inherent advantage to either method?