chatgpt write a function that validates password in javascript. Must be 8 characters long, have an uppercase char and a number. include a descriptive error message and a boolean to indicate success or failure. handle each case separately.