Check your data against regular expressions or known keywords. "Sometimes it’s necessary to check whether certain data is true or false. Writing regular expressions for those cases is redundant and to be frank – boring. The is.js project aims to simplify the testing process....." Article: http://rthor.is/javascript/cross-plugin-javascript-project-isjs/ https://github.com/rthor/isjs