how to check if an object exists in javascript -
i want check if window.sessionstorage object exists. way it:
if (window.sessionstorage) in javascript?
if(sessionstorage.length == 0) { //do } that validate whether sessionstorage empty or not. alternatively, can use this:
if(typeof(sessionstorage) == 'undefined') { //do }
Comments
Post a Comment