English 中文(简体)
这些 j言的含义是什么?
原标题:What does these javascript expressions mean?

这些是我试图学习的假想中的法典。 这些变量被重新计算,以尽量减少档案规模,因此变得不可渗透。

function sort(b) {
            for (var d = [], c = 0; c < this.gs.length; c++) for (var g = 0; g < this.gs[c].length; g++) d.push(this.gs[c][g]);
            b && d.reverse();
            return d
}

我承担这种职能时,要么不明确,要么是b的参数,要么回到2个阵列。

What does the b && d.reverse() mean? Does it mean if b has a value, reverse d?

另一种表述是:

b = this.sort(g == "left" || g == "top");

这意味着什么?

问题回答

<代码>b && d.reverse()指的是什么? 是否意味着<条码>b有价值,相反<条码>d<>。

更正 The ssmart-ass edition

if (b) d.reverse();

reverse() is an in-place operation, so it changes the array it operates on (hence the code does not care for its return value here).

其他声明也以类似方式运作:

b = this.sort(g == "left" || g == "top");

评价始于g = “left” ± g ==“top。 依据<代码>g的价值,该数值为<代码>。 该结果通过sort(),其收益价值随后储存在b

b && d.reverse() 系指,如果 b不实、无效、未定义或0,那么(......)则处决。 换言之,如果我们不通过任何理由(b)来履行这一职能,或者通过虚假/0,那么,那么,反之()就没有执行。

第二句话只是真实的或虚假的。 它只是正常的OR操作,而g必须“偷窃”或“上站”。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签