So I've been trying out Codecademy in my spare time and I'm quite confused as to why the accepted output in Codecademy refuses to work in Eclipse.
Code:
var legalDrivingAge = 18;
var canIDrive = function (myAge) {
if (myAge >= legalDrivingAge) {
return true;
} else {
return false;}
};
canIDrive(prompt("Age?"));/CODE]
Also, Eclipse doesn't accept console.log, function, and prompt but Codecademy uses them. Why doesn't it work in Eclipse? When I was making a new class in Eclipse it gave me a warning that use of the default package is discouraged, however that is the only package I have available. What should I be using?
FWIW I'm on OS X 10.8.2.
EDIT: Nevermind it was just a situation of Java vs Javascript.
Last edited: