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

What is Wrong with this Exercise?

Level 11 lesson 7 Cookie Concept
I can't Pass this exercise whatever way I am trying it shows wrong answer
please help me to pass this question
I want the answer for this qs, i have started this course months ago but still i can't complete this course cuz of the single excercise
by

1 Answer

iamabhishek
Hey, try this:

let cookie = document.cookie;
if(cookie.search("Hello=World")>=0)
{
console.log("Cookie found");
}
else {
document.cookie = "Hello=World";
}
// fetch cookie to print value
cookie = document.cookie;
document.write(cookie);

Login / Signup to Answer the Question.