Last active
June 15, 2018 22:18
-
-
Save mattbontrager/fe8381ac3130c35f1c69fe968177d37e to your computer and use it in GitHub Desktop.
Find different words between to strings.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.different = function(str2) { | |
const arr1 = this.split(/\W/); | |
const arr2 = str2.split(/\W/); | |
return arr1.diff(arr2).join(' '); | |
}; | |
// requires this as well | |
// https://gist.github.com/mattbontrager/7500cc5696ff4efe249f2ac0adbeb8ec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment