I'm learning Javascript and I've gotten to conditionals. When I declare a variable 'sale' and assign it a value of true, my if statement runs, but if I reassign the value of sale to false, the code does not execute. Why is this happening?
let sale = true;
if (sale){
console.log('Time to buy!');
}
The above code executes, but the following code doesn't and I don't understand why. I'm new to coding.
let sale = false;
if (sale = false){
console.log('Enough inventory');
}