Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
335 views
in Technique[技术] by (71.8m points)

javascript - JavaScript的隐藏功能? [关闭](Hidden Features of JavaScript? [closed])

What "Hidden Features" of JavaScript do you think every programmer should know?(您认为每个程序员应该知道哪些JavaScript的“隐藏功能”?)

After having seen the excellent quality of the answers to the following questions I thought it was time to ask it for JavaScript.(在看到以下问题的答案的优秀品质之后,我认为是时候向它询问JavaScript了。) Hidden Features of HTML(HTML的隐藏功能) Hidden Features of CSS(CSS的隐藏功能) Hidden Features of PHP(PHP的隐藏功能) Hidden Features of ASP.NET(ASP.NET的隐藏功能) Hidden Features of C#(C#的隐藏功能) Hidden Features of Java(Java的隐藏功能) Hidden Features of Python(Python的隐藏功能) Even though JavaScript is arguably the most important Client Side language right now (just ask Google) it's surprising how little most web developers appreciate how powerful it really is.(虽然JavaScript现在可以说是最重要的客户端语言(只是问谷歌)但令人惊讶的是,大多数网络开发人员都很少理解它的实力。)   ask by community wiki translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You don't need to define any parameters for a function.(您无需为函数定义任何参数。)

You can just use the function's arguments array-like object.(你可以使用函数的arguments类似数组的对象。) function sum() { var retval = 0; for (var i = 0, len = arguments.length; i < len; ++i) { retval += arguments[i]; } return retval; } sum(1, 2, 3) // returns 6

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...