javascript - Browser needs reload for method to re work -


this meteor client code located in client/lib.js returns true first time if method called again returns false. 2 exact calls happens in browser console.
unless hard reload page, works again correctly first time only.

why , how fix it? thanks

validate = (function () {   const patterns = {     usernamepat: new regexp('^[0-9a-za-z]{16}$', 'g')   };   return {     username: (name) => {       return patterns.usernamepat.test(some_username);     }   } }()); 


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -