dgo
dgo

Reputation: 3937

What is this notation in Chrome Devtools Autocomplete?

Next to append in Chrome Devtools autocomplete, there is a little m. It shows up to various values that don't seem related. For example; with the situation below, it also showed up next to length.

What is it?

Next To Append

Upvotes: 0

Views: 69

Answers (1)

woxxom
woxxom

Reputation: 73546

It is a suggestion-subtitle that shows the item type when V8 engine can deduce it.

Sometimes you can see human-readable types such as Object, Node, Document, etc.
Sometimes it's derived from the prototype function and in your case minified jQuery library uses m class object (the letter is assigned randomly by the minification tool used to produce the bundle):

m.each({
    appendTo: "append",
    prependTo: "prepend",
    insertBefore: "before",
    insertAfter: "after",
    replaceAll: "replaceWith"
}, function(e, t) {
    m.fn[e] = function(e) {
        var n, r = 0, i = [], o = m(e), a = o.length - 1;
        for (; a >= r; r++)
            n = r === a ? this : this.clone(!0),
            m(o[r])[t](n),
            h.apply(i, n.get());
        return this.pushStack(i)
    }
});

Effectively, m stands for jQuery class object, which is the returned type of append function.
If you would use the original non-minified jQuery library, the subtitle would display jQuery.

Upvotes: 1

Related Questions