JavaScript code that can be used client-side in the browser and server-side in Node.js

Sample code as follows, read comments for more details 🙂 /** * Example of JavaScript code that can be used client-side in the browser and server-side in Node.js * * Usage in browser: * <script src=”shared.js”></script> * <script> * console.log(shared.STATUS_SUCCESS, shared.test()); // note that shared.getTimestamp() won’t work * </script> * * Usage in Node.js: * …

Different alignment and order of columns on mobile/desktop using Bootstrap 5

Scenario: Build a pagination partial consisting of 3 parts – the item range (e.g. “Showing 1 – 10 of 30 results”), a dropdown to select the page and a dropdown to select the number of items per page. The 3 parts will be displayed in a different order and have different text alignment on mobile …