javascript - Is there a quicker way to write conditional statements? -


i have statement this:

 if(window.location.hash != '' && window.location.hash != '#all' && window.location.hash != '#') 

can write have mention window.location.hash once?

the obvious way is:

var h = window.location.hash; if (h != '' && h != '#all' && h != '#') 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -