skip to Main Content

Javascript – JS undefined and NULL checker not working

for(const id of this.extraRooms) { let doesRoomExist = document.getElementById('newRoomAddress' + newRoomId); //if(typeof(doesRoomExist) !== "null") if(typeof(doesRoomExist) !== "undefined") { const newRoomLabel = document.getElementById('newRoomAddress' + newRoomId).value { Probably a simple fix but if doesRoomExist is NULL it is still going inside the…

VIEW QUESTION
Back To Top
Search