Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAleksejs Sitdikovs
4,076 PointsNot working JS script printList
Hello everyone, I don't know why, but for me, JS Script printList from file helpers.js is not working. I did assign it in HTML file, but in a console, it shows. "printList is not defined at playlist.js:4" HTML file: <scrit src="js/helpers.js"></scrit> <script src="js/playlist.js"></script>
playlist.js : var playList = []; playList.push("I Did It My Way");
printList( playList);
I have checked, the file is assigned correctly, camelToe is used everywhere. I don't know, what causes that problem, any ideas? Or it is just a bug from Chrome?
KRIS NIKOLAISEN
54,971 PointsNot sure. I'd have to see the complete code.
3 Answers
KRIS NIKOLAISEN
54,971 PointsIt looks like you have
<scrit src="js/helpers.js"></scrit>
instead of
<script src="js/helpers.js"></script>
Aleksejs Sitdikovs
4,076 PointsLol, really? :D Jeeez, I will need to change my glasses, I inspected that line for like 20 times :D
handy christian
2,899 Pointshey, how to make a code printed with background black behind in it?
KRIS NIKOLAISEN
54,971 PointsJavascript is case sensitive. You declared playlist with a lowercase l. But then you use methods on playList with an uppercase L. This results in error: Uncaught ReferenceError: playList is not defined.
Change the l to uppercase in your first two lines of code so you have:
var playList = [];
playList.push('I did it my way');
playList.push('Respect','Imagine');
playList.push('Johana');
playList.unshift ('Born to run');
printList( playList );
Omar Ocampo
3,166 PointsYou're absolutely right Kris, thanks a lot. Oh by the way, I have a " > " signal appearing at the end of the list, could you please check again and let me know why?
Thanks again
Omar
Omar Ocampo
3,166 PointsThis is not an answer, is a question
var playlist = []; playlist.push ('I did it my way'); playList.push ('Respect','Imagine'); playList.push('Johana'); playList.unshift ('Born to run');
printList( playList );
Hey guys, could anyone help me with this, is not print the spectated list, I'm following the Dave McFarland video, thanks in advance for your help.
KRIS NIKOLAISEN
54,971 PointsKRIS NIKOLAISEN
54,971 Pointshandy christian - check out the markdown cheat sheet at the bottom of the page