I want compare two variables, that are strings, but I am getting an error.
I used below function to compare two strings and It is working good.
function CompareUserId (first, second) { var regex = new RegExp('^' + first+ '$', 'i'); if (regex.test(second)) { return true; } else { return false; } return false; }