main.js: typo (chartAt instead of charAt)