fr

Test Question Javascript - Fundamentals

The certificate variable is not attainable outside the if loop

Easy

What's the problem with this code?

const student  = "INSA"; 
if (student === "INSA") 
{ 
        let certificate = true; 
        console.log('In this block, student='+student+'; certificate='+certificate); 
} 
console.log('In this block: student ='+student+'certificate='+certificate); 
Author: W3D teamStatus : Published(updated)Question answered 1,661 times
6
Reviews from developersNo one has evaluated this question yet - be the first!
⚠️
Your browser is badly|not supported!
We recommend you to use a more modern browser such as Edge, Chrome or Firefox
Know More