$('<ul/>')
Creates a new UL element not attached to the DOM
$('<ul/>', {'class':'my-new-list'})
Sets the DOM variables for this element using a pair of key values. So now you have an UL element with the my-new-list class.
$('<ul/>', {'class':'my-new-list', 'html': items.join('')})
This takes an array of LI elements created above, connecting the elements together in a string (without a separator in this case .join('-') would put a hyphen between each LI element) and assign it an internal UL html.
$('<ul/>', {'class':'my-new-list', 'html': items.join('')}).appendTo('body');
Finally, it adds the newly created UL element with this child LI element to the BODY element, making it visible on the page.
source share