I didn't think of that, but answered the question directly. This provokes me to try to come up with fuller answers next time.
Based on what I've seen on these sites, the sites have rating systems, with comments on why the customers rated the freelancer they hired as they did. Choosing those with the highest ratings that are similar to your coding requirements would be appropriate.
Find out what experience and training the coder has. What kinds of projects has he done?
It would require that we have a very good idea of what the code is supposed to accomplish, so we can explain everything carefully.
Note what will the code will run on -- Mac desktop? Windows phones? App for toasters? -- so the coder will have the best chance of coding to the project. This probably doesn't apply to JS, though.
Have a time frame for the project so the coder will know whether he can handle a rush project.
We should be ready to give him any code already written so he can test it with, if appropriate.