such if is very dangerous, please use
if (event.keyCode === 13) saveUserName()
or
if () {
  saveUserName()
}