This forum is now read-only. Please use our new forums! Go to forums
Java , 27/28
Hi guys , Can you tell me what is wrong with this code below please ?
var maCouleur =”Bleu”; console.log(maCouleur.length);
Thx
Answer 5456409e7c82ca9ee2004bfa
Answer 5456fa4a7c82ca08760070e6
var maCouleur ="Bleu";
console.log(maCouleur.length);
your code is perfectly fine assuming that the instructions ask for the variable to be called maCouleur
I don’t know if there’s a French version for all the exercises by my exercise asks for the variable to be called myColor
Answer 545765377c82ca5c36007dd0
Hi,
I’ve exactly same problem… my code is refused even it works correctly (result in console is correct) !
message is :
Oups, merci de réessayer. On dirait que vous n'affichez pas la longueur de maCouleur dans la console !
// Sur la ligne 2, écrivez votre premier commentaire; ça peut être n'importe quoi !
// hjhjhjkh
maCouleur="rouge";
console.log( maCouleur.length );
If I go to this page : http://www.codecademy.com/courses/getting-started-v2/4/4 which is same exercise in english, code is OK ! I’ve try to use myColor instead of maCouleur but it doesn’t work.
I’ve also try this code with same problem:
// Sur la ligne 2, écrivez votre premier commentaire; ça peut être n'importe quoi !
// hjhjhjkh
maCouleur="rouge";
maCouleur.length;
I’m French using Fedora 20 and Firefox (I’ve same problem using Chrome).
Regards.
Answer 54553be8282ae30b940029ba
put quotes around macouleur
Answer 545663377c82ca4ec100519d
1 comments
You do not hard code the number. The point of coding is to make the computer do the work for you. You need to use the variable and .length to do that.
Answer 5456935c7c82ca1526005cc1
Here is the final source…
var myColor = "blue";
console.log("blue".length);
1 comments
No. You do not retype the string a second time. You always use the variable otherwise what’s the point in declaring it in the first place!
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
1 comments
No. NEVER put quotes around a variable’s name.