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 trial

JavaScript JavaScript Basics (Retired) Creating Reusable Code with Functions Returning a Value from a Function

something weird is happening

this is not my code. everytime I restart this, I get different screens. it was originally blank. It keeps changing

script.js
function getYear
var year = new Date()
.getFullYear(){
}
index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Kim,

It sounds like some sort of caching issue. When I launch the challenge, I do just get the blank code box to start the challenge.

I suggest you clear you cache and then re-launch the challenge. If that fails, try logging out of Treehouse, clearing your cache, quitting your browser and then relaunching everything fresh.

If all else fails, you'll need to contact the Treehouse Support Team for this. Just remember that today is a Holiday in the US, so the Support Staff may not get back to you until tomorrow.

Hope you get it sorted out. :) :dizzy:

thank you. i'm trying to get the last two questions done so i'll be finished. i've tried clearing my cookies and history. it seems to be happening with my laptop more than my new computer. the last two are sticking too .

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,735 Points

Challenge Task 1 of 3 we just want to define the function:

function getYear() {

}

Then Challenge Task 2 or 3 they want us to add that line code inside the function, and return the year variable:

function getYear() {
  var year = new Date().getFullYear();
  return year;
}

Something went wrong where you're missing some parts of it.

I know that it's wrong Brendan. I didn't write it. it's coming up by itself in random ways.