Skip to content

Commit

Permalink
else is not necessary here
Browse files Browse the repository at this point in the history
else is not necessary here since all if branches return, consider removing it to reduce nesting and make code more readable.
  • Loading branch information
w3bdesign committed Mar 5, 2021
1 parent 8eca108 commit a07c6a4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions utils/functions/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ export const trimmedStringToLength = (string, length) => {
if (string.length > length) {
const subStr = string.substring(0, length);
return subStr + '...';
} else {
return string;
}
return string;
};

/**
Expand Down

0 comments on commit a07c6a4

Please sign in to comment.