Tengo un script cuando uso la biblioteca typed.js. Estoy tratando de generar 3 líneas + 1 final. El código funciona generando 2 líneas + 1 final. Al intentar solucionarlo, el código se congela sin enviar un error.
Esta versión del código funciona sin errores. Salidas 2 líneas + 1. 
const lineNumber = app.id !== 2 ? ++app.id : (app.id += 2); setTimeout(() => { const typed = new Typed(`#line${lineNumber}`, { strings: text, typeSpeed: speed, onComplete: callback, }); }, timeout); }; $.getJSON(ipgeolocation, (data) => { writeLine(["line1"], 30, () => { if (app.skippedIntro) return; clearCursor(); const usernames = ['user', 'dude']; const ip = data.ip ? data.ip : usernames[Math.floor(Math.random() * usernames.length)]; const country = data.country_name ? data.country_name : 'your country'; writeLine([`line2`], 30, 500, () => { if (app.skippedIntro) return; clearCursor(); writeLine([`start`], 120, 500, () => { timeouts.push( setTimeout(() => { if (app.skippedIntro) return; clearCursor(); setTimeout(() => { skipIntro(); }, 500); }, 1000) ); }); }); }); }); Esta versión del código no funciona. De acuerdo con la idea, debería generar 3 líneas + 1. 1. 
const lineNumber = app.id !== 2 ? ++app.id : (app.id += 2); setTimeout(() => { const typed = new Typed(`#line${lineNumber}`, { strings: text, typeSpeed: speed, onComplete: callback, }); }, timeout); }; $.getJSON(ipgeolocation, (data) => { writeLine(["line1"], 30, () => { if (app.skippedIntro) return; clearCursor(); const usernames = ['user', 'dude']; const ip = data.ip ? data.ip : usernames[Math.floor(Math.random() * usernames.length)]; const country = data.country_name ? data.country_name : 'your country'; writeLine([`line2`], 30, 500, () => { if (app.skippedIntro) return; clearCursor(); writeLine([`line3`], 30, 500, () => { if (app.skippedIntro) return; clearCursor(); writeLine([`start`], 120, 500, () => { timeouts.push( setTimeout(() => { if (app.skippedIntro) return; clearCursor(); setTimeout(() => { skipIntro(); }, 500); }, 1000) ); }); }); }); }); });Tenemos las bandas principales y cuando llegas a 3, necesitas sumar 2 para aprender la 5ta.
const lineNumber = app.id !== 3 ? ++app.id : (app.id += 2);