Javascript #25


What did i do wrong?


You need to place your string substring method inside the parenthesis of your console.log() method to display the data. kindly look on the syntax below for your reference.


Hope this helps


if you use myCountry.length === 2
you are using the comparison operator ===
which will result into a Boolean value
in this case it will result in a Boolean false
console.log( myCountry.length === 2 );
will Display false

You were required to use
console.log( myCountry.length );

You cannot take a substring() from a console.log() Method

With a console.log() Method you can Display a variable-value.

you can however
create a substring() from the associated-Value to the myCountry variable


and then Display the result

console.log( myCountry.substring(0,2) );


google search
== the Book ==
javascript [your question]

== discussions / opinions ==
javascript [your question]

== guidance == <---JavaScript code-convention