Online Demo: https://jsfiddle.net/72subv99/1/.
Special Thanks: .
Online Demo: https://jsfiddle.net/72subv99/1/.
Special Thanks: .
// This is free and unencumbered software released into the public domain. | |
// Marshals a string to an Uint8Array. | |
function encodeUTF8(s) { | |
var i = 0, bytes = new Uint8Array(s.length * 4); | |
for (var ci = 0; ci != s.length; ci++) { | |
var c = s.charCodeAt(ci); | |
if (c < 128) { | |
bytes[i++] = c; | |
continue; |
/** | |
* An array forEach with a delay between steps. | |
* | |
* @param {Function} callback Function to execute for each element. It receives three arguments, the element value, the element index and the array being traversed, respectivily. | |
* @param {Number} timeout Number of milliseconds that the function call should be delayed by. | |
* @param {Object} thisArg Object to use as this when executing callback. | |
* @this {Array} | |
* @return {undefined} | |
*/ | |
Array.prototype.delayedForEach = function(callback, timeout, thisArg){ |