<script>
(function() {
$('html').addClass('js');
var contactForm = {
container: $('#contact'), <-- THIS COMMA
init: function() {
$('<button></button>', {
text: 'Contact Me'
})
.insertAfter('article:first')
.on('click', this.show);
}, <---------------------------------- AND THIS COMMA
show: function() {
contactForm.container.show();
}
};
contactForm.init();
})();
</script>
In the above script, I noticed:
container: $('#contact'),
Is that one way to declare a variable? Doing the following breaks the script:
var container = $('#contact');
Also, what is with the commas after the init function and the container variable (if it is a variable)?