Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Lesson 8 level 8 not working

Create a global variable named a using let keyword and give value "Hello" to it.
Then, create a local variable named b using let keyword within the function body of greeting() function and give value "Studytonight" to it.
Click on the Run and you should get an exception in the output.

/ Add global variable a here*/
let a = "Hello";

function greeting() {
/* Add the local variable here
/
let b = "Studytonight";

console.log(`${a} ${b}`);
}
greeting();
console.log(a + b);

Console panel is showing "try again"!
What should I do?
by

2 Answers

iamabhishek
It is showing Try again because the code is giving error, but still you should be able to progress with this lesson if you define the variables a and b correctly.
niyitanga
Me I tried it but it can't be possible
let b="Studytonight";
let a = "Hello";
function greeting() {
console.log(`${a} ${b}`);
}
greeting();
console.log(a + b);

Login / Signup to Answer the Question.