Skip to content

Commit 3f3bf54

Browse files
authored
Add Remove All Whitespace in JavaScript (#4268)
1 parent 91faf21 commit 3f3bf54

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const die = () => {
2+
console.log("Usage: please provide a string");
3+
process.exit(1);
4+
}
5+
6+
if (process.argv.length != 3) {
7+
die();
8+
}
9+
10+
process.argv[2].length > 0
11+
? console.log(process.argv[2].replace(/\s/g, ''))
12+
: die();

0 commit comments

Comments
 (0)