What does this construct mean?

Posted by ArneRie on Stack Overflow See other posts from Stack Overflow or by ArneRie
Published on 2010-05-10T10:58:19Z Indexed on 2010/05/10 11:04 UTC
Read the original article Hit count: 328

Filed under:

Iam debugging some javascript, and cant explain what this "||" does?

  loadingError: function(title, msg){
        var title   = title || 'Error';
        var msg     = msg || 'Error on Request';

        new my.widget.InformationBox({
            title: title,
            message: msg,
            type: 'error'
        }).show();
    }

Can someone give me an hint, why this guy is using var title = title || 'ERROR' ??

© Stack Overflow or respective owner

Related posts about JavaScript