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 trialIfe Ramsey
1,477 PointsWhy does activity say "Unexpected AST node type passed to processExpressionStatement method: VariableDeclaration"?
The two hidden list items are showing and the div remains hidden. The preview shows the activity has been resolved. See code attached. Any help is appreciated.
<!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 $hidden = $('li:hidden');
$hidden.show();
8 Answers
Steven Parker
231,236 PointsYour selector is good, and you can pass the challenge if you avoid the intermediate variable:
$('li:hidden').show();
But in theory, your version should work as-is. You might want to report this as a bug to the Support folks.
James Rennie
16,807 PointsTreasure Porth This should be fixed. Why is this taught this way if the test says the way it was taught is wrong?
Ife Ramsey
1,477 PointsThanks Steven. I followed the example from the previous activity and arrived at:
const $hidden = $('li:hidden'); $hidden.show();
I will report the bug.
Ife Ramsey
1,477 PointsSupport informed me this is not a bug and the activity does work correctly with the right answer. I was able to satisfy the task with $('li:hidden').show();
Thank you for your help
Steven Parker
231,236 PointsI guess they're being very particular about what constitutes the "right" answer!
Your original one would certainly have worked in a practical situation.
Ricki Barnes
2,553 PointsSame for me as well, though this was the first hit that came up when I googled the error, so I guess it was pretty easy to resolve at least?
Emeline Lawford
9,108 PointsI had this issue too.
Anthony Kimberly
11,049 PointsApril 2021 and I'm still having this issue. Could someone in the know come in here and tell us why this isn't a bug?
This should work:
const $hidden = $('li:hidden');
$hidden.show();
Steven Parker
231,236 PointsIt does work, as you can see in the preview. But apparently the bug in the evaluator still hasn't been fixed. You might want to report it again.
James Steele
2,844 PointsI had the same issue here. The very previous video had Treasure writing code in the exact same format to hide odd anchor tag elements. I copied that format and it failed and I don't know why. I can try the version mentioned above but odd to include it as an example in the previous video.