Search code examples
javascriptjquery

"{}" what does this mean in the below function?


some of these code I understand but "{}" what does this mean...??

var Accordion = function(el, multiple) {
        this.el = el || {};
        this.multiple = multiple || false;

        // Variables
        var link = this.el.find('.link');
        // Eventos
        link.on('click', {el: this.el, multiple: this.multiple},this.dropdown)
    }

Solution

  • // if "this.el" didn't exist, assign it to an empty object {}
    this.el = this.el || {};
    console.log(el);
    

    Try it here