Hello, I have been taking in these JS lessons today and stuck on one of the assessments on conditionals at the bottom of the page.
Above is a link to the assessment. It is #3 at the bottom of the page.
Below is the code plus my switch statement that I cant get to return any value in response at all.
Can someone please tell me what I am doing wrong and point me in the right direction?
let response;
let score = 1;
let machineActive = true;
if(machineActive) {
switch (score) {
case score > 0:
response = âNice!â;
break;
}
}
else {
response = âThe machine is turned off. Turn it on to process your score.â;
}
// Donât edit the code below here!
section.innerHTML = â ';
let para1 = document.createElement(âpâ);
let para2 = document.createElement(âpâ);
para1.textContent = Your score is ${ score }.
;
para2.textContent = response;
section.appendChild(para1);
section.appendChild(para2);