什么意思是“一个字:”在javaScript中定义函数之前? [英] what means "a word:" before define a function in javaScript?

查看:117
本文介绍了什么意思是“一个字:”在javaScript中定义函数之前?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个javaScript示例:此示例中的
在定义函数之前使用了单词和:。它是什么?请帮助我...

I have a javaScript sample: in this sample is used words and ":" before define function. what is it? please help me...

Jb.prototype = {clickButton: function (a, b, c) {
    var d = this, e = d.selected, f = d.chart, g = d.buttons, h = f.xAxis[0], i = f.scroller && f.scroller.getUnionExtremes() || h || {}, k = i.dataMin,
        j = i.dataMax, l, m = h && t(z(h.max, o(j, h.max))), p = new Date(m), n = b.type, r = b.count, i = b._range, w;
    if (!(k === null || j === null || a === d.selected)) {
        if (n === "month" || n === "year")l = {month: "Month", year: "FullYear"}[n], p["set" + l](p["get" + l]() - r), l = p.getTime(), k = o(k, Number.MIN_VALUE), isNaN(l) || l < k ? (l = k, m = z(l + i, j)) : i = m - l; else if (i)l = v(m - i, k), m = z(l + i, j); else if (n === "ytd")if (h) {
            if (j === s)k = Number.MAX_VALUE, j = Number.MIN_VALUE, q(f.series, function (a) {
                a = a.xData;
                k = z(a[0], k);
                j = v(a[a.length - 1], j)
            }), c = !1;
            m = new Date(j);
            w = m.getFullYear();
            l = w = v(k || 0, Date.UTC(w, 0, 1));
            m = m.getTime();
            m = z(j || m, m)
        } else {
            E(f, "beforeRender", function () {
                d.clickButton(a, b)
            });
            return
        } else n === "all" && h && (l = k, m = j);
        g[e] && g[e].setState(0);
        g[a] && g[a].setState(2);
        f.fixedRange = i;
        h ? h.setExtremes(l, m, o(c, 1), 0, {trigger: "rangeSelectorButton", rangeSelectorButton: b}) : (c = f.options.xAxis, c[0] = u(c[0], {range: i, min: w}));
        d.selected = a
    }
}, defaultButtons: [
    {type: "day", count: 1, text: "1d"},
    {type: "week", count: 1, text: "1w"},
    {type: "month", count: 1, text: "1m"},
    {type: "month", count: 6, text: "6m"},
    {type: "year",
        count: 1, text: "1y"},
    {type: "all", text: "All"}
]
}

单词clickButton是什么意思,代码中的defaultButtons?

what means words "clickButton" , "defaultButtons" in code?

推荐答案

这是 object literal ,其中包含函数表达式。你知道对象文字吗?

This is an object literal with function expressions in it. Do you know about object literals?

x = {asdf: 1, fdsa: 2}

将创建一个对象,其属性为 asdf fdsa 分别设置为 1 2 。有问题的对象文字只有更复杂的属性值。

will create an object with properties asdf and fdsa set to 1 and 2 respectively. The object literal in question simply has much more complex property values.

这篇关于什么意思是“一个字:”在javaScript中定义函数之前?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆