Skip to content

Instantly share code, notes, and snippets.

@rubeniskov
Last active April 10, 2016 18:29
Show Gist options
  • Save rubeniskov/0ddfa4f1b01176d418dd to your computer and use it in GitHub Desktop.
Save rubeniskov/0ddfa4f1b01176d418dd to your computer and use it in GitHub Desktop.
/*
Author: Rubén López Gómez
Gist: https://gist.github.com/rubeniskov/0ddfa4f1b01176d418dd
*/
var sufix = function() {
return Array.prototype.slice.call(arguments).map(function(v, i, parts) {
return parts[i + 1] ?
v.replace(new RegExp(parts[i + 1] + '$', 'i'), '') :
[v.charAt(0).toUpperCase(), v.slice(1)].join('');
}).join('')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment