A few things to consider, for any language, then a couple of things specific to JS.
- Inside if statements etc are they in the correct order. i.e. starting with mostly likely to occur descending to least likely to occur.
- Are you doing any calculations that aren't required.
- Is your code overly abstracted?
- Can you offload any of the work? Specifically for JS this would take the form of web workers.
- Does the code utilise too many 3rd party libraries?
- For the code that does require a 3rd part library - is that code optimised as well or is it just thrown together?
Specifics for javascript:
Check out this comment I gave for a very similar question:
hashnode.com/post/what-is-difference-cjy15gkwy002…
You can also manually check by comparing performance.now() values either side of a section of code execution. Then refactor some parts and then try again and iterate.