What’s the correct way to markup the code in JavaScript syntax boxes? I’ve seen lots of different approaches, e.g.:
<var>str</var>.codePointAt(<var>pos</var>)
<em>myMap</em>.get(key);
<var>gen</var>.return(value)
Is em
or var
preferable? (em
seems less technically correct, but it’s present in the editor GUI, which is very helpful.) Also, what items should get italicized?
I did some searching in the MDN guidelines, but didn’t find any info about this.