Skip to content

Instantly share code, notes, and snippets.

@imbcmdth
Forked from anonymous/lerpArray.js
Last active August 29, 2015 14:16
Show Gist options
  • Save imbcmdth/a2a0c61c27248c7e82a9 to your computer and use it in GitHub Desktop.
Save imbcmdth/a2a0c61c27248c7e82a9 to your computer and use it in GitHub Desktop.
var a = 'Going down to brown town';
String.prototype.lerp = function(n){
var ai = Math.floor(n);
var t = n - ai;
var a = this.charCodeAt(ai);
var b = this.charCodeAt(ai + 1);
return String.fromCharCode(a + (b - a) * t);
}
console.log(a.lerp(6.2));
// I'm only doing this because I know it'll annoy *everyone*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment