You can read about if you search for markdown code-formatting (keep in mind to have a empty line before and after you codes)
If you wrap your code in singel-` you get online code with the grey background
this is a one liner
if you want this with multiline use 4-spaces (in every line + your own indention).
asdfasdfasdf
asdfasdfasdf
asdfas
and as @lehresman said there is another mardown syntax --> with 3-` where you need no 4-space idention
function hallo () {
var test = 123;
}