The following function works and does its intended job - returns the desired value as specified.
function returnValue() {
return(
"value");
}
Just the return value is split into a new line.
If the pair of parentheses is dropped as follows then, it returns undefined
.
function returnValue() {
return
"value";
}
The IDE I'm using issues a warning as follows.
Code has no side effects
It seems like "value" is not part of the return
statement itself.
Why do they both behave differently?