I am having trouble with 24. Variables need help


I am having trouble with 24. Variables and need help I coded console.log(var myAge===25); and it still said something is wrong I tried different ways to code it and still got it wrong. Any one got some pointers or can be of some assistance?


you have all the right elements just the wrong order.
Define the myAge variable

var myAge = 25

then console log myAge.

console.log (myAge);

Also, for defining variables only use 1 equals sign.
1 equals sign is used for assignment.
2 and 3 are used for comparison.



Means to print "var myAge===25".


@zeroclifawn Seems to have said what I was about to say, so I will just say this:

You must define the variable, then print it using console.log.


var ____ = 14




Thank you guys I appreciate that.


Hey @ragezapper or @zeroclifawn I'm also having trouble with 25. More Variable Practice I'm stuck once again. Here is what I have...
// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry=Ethiopia;

// Use console.log to print out the length of the variable myCountry.
var myCountry=Ethiopia

// Use console.log to print out the first three letters of myCountry.
var myCountry=Ethiopia
Can you guys give me some examples of what to do I would appreciate it thanks.


Having the same problem. Would really appreciate anyone with help.


when defining a string value make sure you put it in quotes.
Ex. var thing = "Things"

also you only have to type your variable in once and it will be remembered as myCountry for the rest of this exercise.


To make this easier to classify, I'll show you the ways I'm gonna explain it:

Now let's start!:smiley:

Well, as @zeroclifawn had said, you need to define your variable as a string:

var ___ = "_____"

And you see the "substring" functions you put? You only need one of the ones you put. These are not needed:

In your first part, it just said to declare your variable as a string, so you don't have to do anything with the substring function.

In the second part, it just says to print the length of myCountry. You already defined myCountry as Ethopia (if you wrote it as a string), so you do not have to write it again.

This part from the second part can be taken out, and this from the third part:

From the second part, it says you need to print the length of myCountry. Do you remember the function of .length?

console.log(myCountry.length) //prints the length of Ethopia


In other meanings, you don't need this:

Now, we're going to your third part.


Remember, in codes, everything starts with 0, and you have to print the first three letters of myCountry.

E t h o p i a
0 1 2 3 4 5 6

To print the first three letters, you must do (0,2), as shown in the diagram above.

Hope it helped!:smiley:


It most definitely did thanks guys.


I Can not see any diagram @ragezapper , please can you show me the diagram as i am also stuck there too

E t h o p i a
0 1 2 3 4 5 6


I need help can u guys help me?
var varName = data ;

var myName = Leng ;

var myAge = 14;

var isOdd = true;

var variableName = 14 ;


Mine keeps saying: It looks like myAge isn't a number.
This is my code
var myAge = /* 14 */



/* and */ means to make it as a comment. :smiley:

Except, unlike //, you can do /* with a long span of lines, not only one.

Problem: / and /


var varName = 'data' ;

var myName = 'Leng' ;

var myAge = 14 ;

var isOdd = true ;

var variableName = 14 ;
Thanks peeps this is what I got :smirk: :smiley:

[quote="ragezapper, post:14, topic:9112, full:true"]
/* and */ means to make it as a comment. :smiley:


Hi all!

Also facing a problem with exercie 24, on variables:
current code looks like this:

if( 10 % 7 === 0 ) {
console.log("The first number is even");
} else {
console.log("The first number is odd");
var myAge = "30";
console.log (myAge);

Yet when I try and save and progress I get a message saying : "oops, looks like myAge; isn't a number"??
Even though it is!....Where am I going wrong with this?


Hey @bitmaster28787,

You put 30 as a string here :smiley::


Still not getting it, can you just give me the answer


Hi can you post your code ?


guys i need serious help nothing is working plezzzzzzzzz:flushed::fries::poultry_leg: