Lines of code aren't at a premium. Why not favor readability over cleverness when possible?
I pity the person who'll be maintain this.
I pity the person who'll be maintain this.
if(!username || username.trim() = '')
return { error: "No Username Given.", field: 'name' };
if(!password || password.trim() = '')
return { error: "No Password Given.", field: 'password' };
and so on.Is that not clever enough??? Even a monkey would understand this.