I'm working on a simple Node.js register/login, and I want the error message to disappear after 2 seconds.
if (password.length < 6) {
setTimeout(errors.push({ msg: 'Password must be at least 6 characters' }), 2000);
}
However, I get an error:
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received 2 at setTimeout (timers.js:122:11)