Two Pointer Algorithm Javascript Substring Email Checker If Valid