coding style - return a conditional statement in javascript -
i have kind of method:
function() { if (condition) { return true; } return false; }
i thought of returning condition , make more clean, , maybe more readable. this:
function() { return (condition); }
is considered practice?
if there no other code returning true/false yes, return condition.
function() { return (condition); }
just said, more readable, less code. wouldn't call practice, it's more first code bad practice.
Comments
Post a Comment