Which is better: 2 tiny or 1 small file?

Hello. On the website go check "mobile device or computer" using php. For that and that I have a separate script files: mobile.js and desktop.js. Both weigh in at 20KB.
Now it looks like this:
<?php if ($desktop == 1): ?>
<script src="js/desktop.js"></script>
<?php else: ?>
<script src="js/mobile.js"></script>
<?php endif ?>


How to do:
1. Leave as is
2. To move the checking device in js and merge these 2 files and if'you have to register there
April 4th 20 at 00:45
2 answers
April 4th 20 at 00:47
I would leave as is.
User shipping will be less
April 4th 20 at 00:49
The client should never download unused code.
Only one thing is unclear: what is this, what is the difference in the logic of work - in 20KB?!

Find more questions by tags PHP