I have a null check in my javascript code that doesn't seem to operating as expected. It goes like this:
if (myVariable) {
// Do things with my variable
}
When I reach the inside of the if statement, Chrome's java console says the value I'm trying to use (myVariable) is null. Perhaps I'm not understanding the if statement properly? The specific line throwing the error is
window.document.getElementById("myElement").innerText = myVariable
Thanks in advance.