Update app.js

Use ternary here to be less obscure. Just like @gusakov.nik proposed.