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 trialAlex Forseth
8,017 PointsWhat am I doing wrong here?
I am selecting the list elements as the way I understand it from the video. I am unsure why I get the below AST node type error. Someone please look at my code and tell me what I am doing wrong. Thank you.
Bummer! Unexpected AST node type passed to processExpressionStatement method: VariableDeclaration
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<h2>Star Trek Characters</h2>
<ul class="character-list">
<li>Captain Jean Luc Picard</li>
<li>Data</li>
<li>Warf</li>
<li>Dr. Crusher</li>
</ul>
<div>I am supposed to stay hidden!</div>
<script
src="jquery-3.2.1.min.js"></script>
<script src="app.js"></script>
</body>
</html>
const $characterList = $('li:hidden');
$characterList.show();
2 Answers
Jason Anders
Treehouse Moderator 145,860 PointsHey Alex,
Challenges and the instructions associated with them are very specific and need to be followed exactly. Here the instructions do not say to create a variable or store the value in one, so by doing so, you are confusing the code checker which will always result in a Bummer!
.
I did not try your code, but I don't see why that wouldn't work... just not what the checker wants.
Keep Coding! :)
Alex Forseth
8,017 PointsSo I can see from a previous post that the answer:
$( "li:hidden" ).show();
will work.
How ever. I fail to see what is wrong with my original answer where I put the hidden list items into a variable and then just simply called that variable on the next line with the show method attached to it.
const $characterList = $('li:hidden'); $characterList.show();
Any input would be appreciated.
Alex Forseth
8,017 PointsAlex Forseth
8,017 PointsThanks for clarifying. I did not take that into account.