25. I'm just confused


#1

im just confused on how to do the code all together if I could get an explanation on how to do I?


Help! #25 Variable Practice
#2

Can you rephrase that @gamingmodoyt?


#3

We cannot give you code. Show us what you've attempted to do.

Here are the step-by-step instructions of what you need to do for this exercise.
1. You need to declare a variable on line 3 called myCountry and give it a string value of a country's name.
2. On line 6, you need to print the length of the variable myCountry by using console.log and the .length property.
3. On line 9, you need to print the variable myCountry, but only the first three letters. You can accomplish this by using console.log and using the substring method on the myCountry variable.


#4

Please check this. How can i solve this problem

// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry = "Bangladesh";

// Use console.log to print out the length of the variable myCountry.
console.log(myCountry.length(0,3) );

// Use console.log to print out the first three letters of myCountry.
console.log(Ban);


#5

.length doesn't require arguments in the way you use it.

Either "Ban" needs to be in quotes, or you need to .substring() myCountry.


#6

// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry = "Bangladesh";

// Use console.log to print out the length of the variable myCountry.
console.log(myCountry.length(0,3) );

// Use console.log to print out the first three letters of myCountry.
console.log(.substring() myCountry);

Does not work


#7

Read the instructions on how to use .substring().

You can't just shove it in and expect it to work.


#8

for the last one, you need to use the variable value which is myCountry and than add a command for the first three letters which is .substring which is followed by (0,3).
remember, you are saving/ embedding the value Bangladesh in to the term myCountry- that's what the variable is for