- check out feross/standard for some javascript style advice and a plugin to autocorrect violations
- never be afraid to write variables with long fuckall names. readability is more important than shorthand
- always wrap code in an IIFE to prevent global namespace pollution
- good job on the wordSubstituter method
- bulkShortener: i'd prefer a map/forEach to a for loop
- if this were in my codebase i'd make you write inline documentation but that's fine here
- triple extra bonus points if you rewrote this in a more class-based manner like:
class Tweet {
constructor(tweet_text) {
this.tweet_text = tweet_text
}
shorten() {
this.tweet_text = this.tweet_text.substr(0, 137)
return this
}
regex() {
// run some regex...
return this
}
}