Quantcast
Viewing all articles
Browse latest Browse all 38

Check to see if integer is between two others

Is there a more efficient way to check to see if a value is bewteen to other values than doing : if(scrollPosition.x > Screen.width*.25 && scrollPosition.x < Screen.width *.49 || scrollPosition.x < Screen.width*.01 && scrollPosition.x > Screen.width*.25){ //code } it would be nice if you could do something like if(Scroll.position.x.isBetween(.25, .49 || .01, .25)){ code// } Is it possible to create a function like this? Thanks for any help.

Viewing all articles
Browse latest Browse all 38

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>