When you are working on a commercial project chances are that you might have to develop some parts of it as a team and someone else might have to maintain your code once you are assigned to the next one.
Keeping the best interests of your team and future maintainers in mind always follow best coding guidelines and practices for a particular language, specify the purpose of each component at the top, input parameters each function takes,its expected output and purpose in comments.
The simplest things to follow are writing code that is easily understood rather than trying to obfuscate the code just to show off, assigning names to variables/objects/functions which are easily to reflect the purpose of defining them and indenting/linting the code.
Writing elegant code would also mean trying to optimize and refactor the existing codebase for performance improvements but we should generally try to do such optimizations towards the end since trying to optimize right from the beginning might slow down the development cycle.