I don’t understand the instructions with this problem
Your code so far
var myNoun = "dog";
var myAdjective = "big";
var myVerb = "ran";
var myAdverb = "quickly";
// Only change code below this line
var wordBlanks = "myNoun" + "myVerb" + "myAdjective" + "myAdverb"; // Change this line
// Only change code above this line
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36.
var myNoun = "dog";
var myAdjective = "big";
var myVerb = "ran";
var myAdverb = "quickly";
// Only change code below this line
var wordBlanks = console.log("myNoun " + "myVerb " + "myAdjective " + "myAdverb "); // Change this line
// Only change code above this line
No, when you are console.log()ing something, you don’t need to declare it as a variable. It is predefined as a function in JavaScript, so you can just type it. Also, when you are trying to console.log() a variable, you DON’T use the " ", You just call it’s name. ex:
var variable1 = "hello world";
console.log(variable1); //This will output "hello world" in the console
A lot of times, you want to combine multiple variable to the log, you can easily do this by using the + operator. Ex:
var variable1 = "hello";
var variable2 = "world";
console.log(variable1 + variable2); //outputs "helloworld"
//you can also add spaces by doing these
console.log(variable1 + " " + variable2); //outputs "hello world"
↑//as you can see there is a space here
var myNoun = "dog";
var myAdjective = "big";
var myVerb = "ran";
var myAdverb = "quickly";
// Only change code below this line
var wordBlanks = "myNoun" + "myVerb" + "myAdjective" + "myAdverb"; // Change this line
console.log(wordBlanks);
// Only change code above this line
because you wont be able to display the result in var wordBlanks just like @Catalactics metioned. its a better way for code standards. Thats another way of doing it.
Here since you already manage to understand i will have snipped code of the problem. this way will be much better of doing it. This is called concatenate. I like the ES5 syntax but ES6 makes it more easy to read and understand, but will be good to learn from the bare bones
var myNoun = "dog";
var myAdjective = "big";
var myVerb = "ran";
var myAdverb = "quickly";
// Only change code below this line
// creating the wordBlanks, and adding the variables with spaces ( + ' ' + )
var wordBlanks = myNoun + ' ' + myVerb + ' ' + myAdjective + ' ' + myAdverb; // Change this line
// Only change code above this line
console.log(wordBlanks);