Skip to content

Commit

Permalink
turned if else into ternary operator
Browse files Browse the repository at this point in the history
  • Loading branch information
croueAlec committed Sep 20, 2024
1 parent 428e1f5 commit 8f7f56d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions nginx/src/js/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ async function fetchPage(pageName) {
return null;
}

if ('title' in data)
document.title = data.title;
else
document.title = "Missing title";
document.title = ('title' in data) ? data.title : "Missing title";

return data.html;
}
Expand Down

0 comments on commit 8f7f56d

Please sign in to comment.