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

2 Answers

KRIS NIKOLAISEN
KRIS NIKOLAISEN
53,389 Points

In this previous video @ 4:00 a function is created that returns a value. And then this function is called with its return value stored in a variable. This is very similar to what the challenge is asking you to do.

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

var yearToday = getYear()

don't forger semicolumn sign after 'getYear()'