var request = { "user" : "alex", "password" : "sdjk23h78dg2" }; if ( /^[a-zA-Z0-9]{8,}$/.test(request.paSSword) ) { // опечатка: request.paSSword console.log(1); };