JS style updates

match core style guide for JS
Add comment; correct spelling in another
Use `setting` as passed var

This more clearly communicates what is being passed around.