-
-
Save imbcmdth/a2a0c61c27248c7e82a9 to your computer and use it in GitHub Desktop.
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
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