S
Silent
Guest
Well, the main problem is that none of your code does anything like what the assignment specifies.
Your CAge1() function creates a date object referencing the current date, then a number object containing the value of that date's year. It does nothing with these values and returns.
Your CAge2() function throws up an alert box with a message referencing a local variable you defined in another function, which of course doesn't work.
I'm assuming this is some kind of homework assignment. If so, I think you need to go back and review your textbook (or whatever) because teaching you how JavaScript works is a little beyond the scope of this question.
Your CAge1() function creates a date object referencing the current date, then a number object containing the value of that date's year. It does nothing with these values and returns.
Your CAge2() function throws up an alert box with a message referencing a local variable you defined in another function, which of course doesn't work.
I'm assuming this is some kind of homework assignment. If so, I think you need to go back and review your textbook (or whatever) because teaching you how JavaScript works is a little beyond the scope of this question.