I'm new to JS and I want to know what value the if (drawer.style.left) takes, at the beginning it's worth -30% (which I think is false) so it goes to the else, and then when I press again enter the if, but I do not understand why if it is now worth -10% and I think it is false.
Thank you very much.
let menu = document.querySelector(".material-icons");
let drawer = document.querySelector("#drawer");
menu.addEventListener('click',function(e){
if(drawer.style.left){
drawer.style.left = '';
drawer.style.transition = 'all 0.8s';
}
else
{
drawer.style.left = '-10%';
drawer.style.transition = 'all 0.8s';
}
});