how to format computer code in APA style
APA 7 provides for computer code: &quot;To present computer code, use a monospace font such as 10-point Lucida Console or 10-point Courier New.&quot;
For my APA 6 thesis, I used italics for my coding examples following APA 6 4.20 (a letter, word, or phrase cited as a linguistic example), taking the position that JavaScript is a language.