I'm new to development, just need to know in terms of memory does it matter using a value without assigning in to a variable
Example 1:
var sendResponse = {
"a": 1,
"b": 2
};
res.send(sendResponse);
OR
res.send({
"a": 1,
"b": 2
});
Example 2:
var valueOne = "hi";
var valueTwo = "hithere";
if (someVariable == valueOne || someVariable == valueTwo) {
//
}
OR
if (someVariable == "hithere" || someVariable == "hi") {
//
}
Example 3:
var concatOne = "hi";
var concatTwo = "hithere";
var concatString = concatOne + concatTwo;
OR
var concatString = "hi" + "hithere";