Skip to content

Commit

Permalink
Add Remove All Whitespace in JavaScript (#4268)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaamkiya authored Jan 12, 2025
1 parent 91faf21 commit 3f3bf54
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions archive/j/javascript/remove-all-whitespace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const die = () => {
console.log("Usage: please provide a string");
process.exit(1);
}

if (process.argv.length != 3) {
die();
}

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

0 comments on commit 3f3bf54

Please sign in to comment.