Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Function objects and Type classes

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article focuses on "how to use Function objects and Type classes". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn how to use Function objects and type classes.

Before we look at the Type class, let's first take a look at a very important object, which is the Function object. Function objects are internal objects of JavaScript, such as date objects (Date), array objects (Array), character objects (String), and (Object,RegExp,Math,Error, etc.). An object can be instantiated through new. In addition to our common functions declared by JavaScript, we can also build our function object in the following way: var myFunction=new Function (arguments,statement). Since I am not familiar with scripting, I am not familiar with prototype (but I heard that it is by giving a prototype object to indicate the type of object to be created, and then using the method of this prototype object to create more objects of the same type, and the original model schema belongs to the object creation mode), but after a simple test, if you extend Function to Function, you can declare the object through new and then reference him. You can also call Function. (method or function) If you use Function.uName directly to extend this uName, you can only call it through Function.uName, which reminds me of the static methods in .NET. With these, let's take a look at a few objects that extend Function in Asp.NET Ajax:

The code is as follows:

Function.__typeName= "Function"

Function.createCallback=function (bmaine a) {

Return function () {

Var e=arguments.length

If (e > 0) {

Var d = []

For (var caterpillar)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report