- 浏览: 71049 次
- 性别:
- 来自: 大连
最近访客 更多访客>>
最新评论
-
newlangwen1:
你好 我想请教个问题,我运行了一下上面的程序,结果是输入什么就 ...
C程序 对文本行进行排序
Function (Built-in Object)
Function (內置對象)
Function is the object from which JavaScript functions are derived. Functions are first-class data types in JavaScript, so they may be assigned to variables and passed to functions as you would any other piece of data. Functions are, of course, reference types.
The Function object provides both static properties like length and properties that convey useful information during the execution of the function, for example, the arguments[] array.
Constructor
var instanceName = new Function([arg1 [, arg2 [, ...]] ,] body);
The body parameter is a string containing the text that makes up the body of the function. The optional argN's are the names of the formal parameters the function accepts. For example:
var myAdd = new Function("x", "y", "return x + y");
var sum = myAdd(17, 34);
Properties
arguments[] An implicitly filled and implicitly available (directly usable as "arguments" from within the function) array of parameters that were passed to the function. This value is null if the function is not currently executing. (IE4+ (JScript 2.0+), MOZ, N3+ (JavaScript 1.1+), ECMA Edition 1)
arguments.callee Reference to the current function. This property is deprecated. (N4+, MOZ, IE5.5+)
arguments.caller Reference to the function that invoked the current function. This property is deprecated. (N3, IE4+)
arguments.length The number of arguments that were passed to the function. (IE4+ (JScript 2.0+), MOZ, N3+ (JavaScript 1.1+), ECMA Edition 1)
arity Numeric value indicating how many arguments the function expects. This property is deprecated. (N4+, MOZ)
caller Reference to the function that invoked the current function or null if called from the global context. (IE4+ (JScript 2.0+), MOZ, N3+)
constructor Reference to the constructor object that created the object. (IE4+ (JScript 2.0+), N3+ (JavaScript 1.1+), ECMA Edition 1)
length The number of arguments the function expects to be passed. (IE4+ (JScript 2.0+), N3+ (JavaScript 1.1+), ECMA Edition 1)
prototype Reference to the object's prototype. (IE4+ (JScript 2.0+), N3+ (JavaScript 1.1+), ECMA Edition 1)
Methods
apply(thisArg [, argArray]) Invokes the function with the object referenced by thisArg as its context (so references to this in the function reference thisArg). The optional parameter argArray contains the list of parameters to pass to the function as it is invoked. (IE5.5+ (JScript 5.5+), N4.06+ (JavaScript 1.3+), MOZ, ECMA Edition 3)
call(thisArg [, arg1 [, arg2 [, ...]]]) Invokes the function with the object referenced by thisArg as its context (so references to this in the function reference thisArg). The optional parameters argN are passed to the function as it is invoked. (IE5.5+ (JScript 5.5+), N4.06+ (JavaScript 1.3+), MOZ, ECMA Edition 3)
toString() Returns the string version of the function source. The body of built-in and browser objects will typically be represented by the value "[native code]". (IE4+ (JScript 2.0+), N3+ (JavaScript 1.1+), MOZ, ECMA Edition 1)
valueOf() Returns the string version of the function source. The body of built-in and browser objects will typically be represented by the value "[native code]". (IE4+ (JScript 2.0+), N3+ (JavaScript 1.1+), MOZ, ECMA Edition 1)
Support
Supported in IE4+ (JScript 2.0+), N3+ (JavaScript 1.1+), MOZ, ECMAScript Edition 1.
Notes
General examples of functions are found throughout the book, but see Chapter 5 for examples of the advanced aspects of functions and the Function object.
详细出处参考:http://www.jb51.net/article/4339.htm
发表评论
-
prototype.js
2010-06-27 20:53 619http://www.cnblogs.com/thinhuna ... -
javascript 中的prototype 说明
2010-06-27 20:50 640http://myfreespace.iteye.com/bl ... -
Javascript继承机制总结
2010-06-27 20:45 884http://info.codepub.com/2007/04 ... -
JavaScript Function对象
2010-06-24 20:44 909http://book.csdn.net/bookfiles/ ... -
深入javascript function对象(二)
2010-06-24 20:41 640http://bbs.51cto.com/thread-568 ... -
深入javascript function对象(一)
2010-06-24 20:40 611http://bbs.51cto.com/thread-568 ... -
Javascript 事件注册机制
2010-06-22 15:15 735http://www.360doc.com/content/0 ... -
全面剖析XMLHttpRequest对象
2010-06-21 20:29 411http://dev.yesky.com/91/2687091 ... -
投机取巧使用tomcat的一点备忘
2010-06-21 17:11 674部署的过程就是将编译后的项目copy到 webapps目录下, ... -
Javascript学习笔记之 HTML DOM Checkbox 对象
2010-06-08 20:16 961http://www.w3school.com.cn/html ... -
Javascript学习笔记之 HTML DOM opener 属性
2010-05-30 23:02 687【转】http://www.w3school.com.cn/h ... -
Javascript学习笔记之 Window 对象
2010-05-30 22:50 622【转】http://www.w3school.com.cn/ ... -
Javascript学习笔记之 JavaScript框架编程
2010-05-29 21:11 701转http://home.phpchina.com/spa ... -
Javascript学习笔记之 用链接对用户进行重定向
2010-05-26 22:37 14362.8 用链接对用户进行重定向 可以根据用户是否打开了Ja ... -
Javascript学习笔记之 闭包
2010-05-23 21:26 587转:http://apps.hi.baidu. ... -
Javascript学习笔记之 apply和call方法
2010-05-21 21:47 704apply方法和call方法都可以将函数绑定到其他对象上执行, ... -
【转】Factory Method(createMethod)模式的javascript实现
2010-05-21 09:45 672本文来自CSDN博客http://blog.csdn.net/ ... -
Javascript学习笔记之 Javascript中的函数
2010-05-20 22:20 572Javascript中的函数在函数调用中,可以通过argume ... -
Javascript学习笔记之函数(Function)对象
2010-05-19 21:41 703【转】http://163.qizhi.blog.163.co ... -
Javascript学习笔记之全局(Global)对象
2010-05-19 20:56 671备忘全局对象的几个属性或方法 1. NaN 特殊值,表示非数 ...
相关推荐
关于javascript function的一些笔记,转过来的一些笔记
JavaScript的function函数详细介绍 通过函数来封装任意多条语句,而且可以在任何地方、任何时间调用执行。 而我们的JavaScript脚本语言比较特殊,相对于C语言,它的参数是不需要数据类型加持的。返回值return,...
理解JavascriptFunction与Object
javascript parse让js 折叠 方便定位到function插件
如: 代码如下: function func() { //body code } (3) 使用JavaScript内置Function对象构造。如: 代码如下: var func = new Function(“/*parameters*/”,”/*body code*/”); 声明变量定义与使用function表达式...
一个JavaScript Function Outliner插件 第四版本 支持内嵌javascript,且可以对javascript进行压缩
javascript Object与Function使用.docx
主要介绍了JavaScript function函数种类,包括普通函数、匿名函数、闭包函数、十分的全面,并附上了示例,这里推荐给大家,希望对大家能有所帮助。
JavaScript中的function使用方法.docx
Simple Log In Function with Javascript
深入理解JavaScript系列(49):Function模式(上篇) 深入理解JavaScript系列(50):Function模式(下篇) 深入理解JavaScript系列(结局篇)">深入理解JavaScript系列(1):编写高质量JavaScript代码的基本...
javascript xml xsl xslt javascript xml xsl xslt javascript xml xsl xslt javascript xml xsl xslt
partial function application, and dynamic functionsoffline detection and storing data on the client machinetechniques for JavaScript in an enterprise environment for better maintainability ...
主要介绍了Javascript Function.prototype.bind详细分析的相关资料,需要的朋友可以参考下
深化浅析JavaScript中的Function类型_.docx
function test() { alert("oec2003"); return false; } c#代码: protected void Button1_Click(object sender, EventArgs e) { ClientScript.RegisterStartupScript(this.GetType(), "clear", ...
, AMD, Asynchronous Operations, Callbacks, Promises and Deferreds, Code Quality, Function Polymorphism, Function Scope, Hoisting and Closures, Functional Programming and Stateless Functions, ...
主要为大家详细介绍了JavaScript function函数种类,包括普通函数、匿名函数、闭包函数,感兴趣的小伙伴们可以参考一下
javascript两种function的定义方式function a(){}和a=function(){}具体使用如下,感兴趣的朋友可以参考下,希望对你对你学习function的定义有所帮助