what means “a word:” before define a function in javaScript?
我有一个javaScript示例:
在此示例中使用单词和":"之前定义函数。 它是什么? 请帮我...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 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"是什么意思?
这是一个带有函数表达式的对象文字。 你知道对象文字吗?
1 | x = {asdf: 1, fdsa: 2} |
将创建一个对象,其属性