Skip to content

Commit

Permalink
feat: Use ternary operator instead of if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaamkiya committed Jan 12, 2025
1 parent 7863131 commit 1aba2fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions archive/j/javascript/remove-all-whitespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ if (process.argv.length != 3) {
die();
}

if (process.argv[2].length > 0) console.log(process.argv[2].replaceAll(/\s/g, ''));
else die();
process.argv[2].length > 0
? console.log(process.argv[2].replaceAll(/\s/g, ''))
: die();

0 comments on commit 1aba2fe

Please sign in to comment.