Чтобы написать это:
function makeHeader(label, width){
newHeader = $("<th/> <br/>").html(label).addClass("col-sm-"+width)
return newHeader
}
В псевдокоде вы можете просто посмотреть на каждое утверждение и посмотреть, что оно делает, и, если вам нужна помощь, взглянуть на документацию jQuery .Но вот полный псевдокод:
Define a function makeHeader, which takes parameters label and width
Define a variable newHeader, which is HTML markup <th></th><br/>.
Set the innerHTML property of the element contained in newHeader to the label parameter passed to the function
Add a class to the element contained in newHeader. The class added will be col-sm- followed by the width parameter passed to the function
Return the newHeader variable from the function