April 24, 2024, 5:55 a.m. | Chandra Prakash Pal

DEV Community dev.to

When we develop any application, we need a random password for every user.As more as secure password is recommended. The conditions for secure password must follow



  1. Minimum 8 character long password

  2. Minimum one uppercase letter

  3. Minimum one lowercase letter

  4. Minimum one special character

  5. Minimum one number.


The combination of above condition will generate a secure password.



function generatePassword(length) {
// code to generate passowrd
var charNum = "0123456789";
var charLower = "abcdefghijklmnopqrstuvwxyz"
var charUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
var charSpecial = "!@#$%^&*_" …

application conditions function javascript letter password random special

CyberSOC Technical Lead

@ Integrity360 | Sandyford, Dublin, Ireland

Cyber Security Strategy Consultant

@ Capco | New York City

Cyber Security Senior Consultant

@ Capco | Chicago, IL

Sr. Product Manager

@ MixMode | Remote, US

Corporate Intern - Information Security (Year Round)

@ Associated Bank | US WI Remote

Senior Offensive Security Engineer

@ CoStar Group | US-DC Washington, DC