ASP. NET Ajax in action-MS Ajax library overview-Basic Type Extension

Source: Internet
Author: User

Array Type Extension

 

Name

Description

Array. Add function

Add an elementArrayThe end of the object. Array. Add (array, item );

Array. addrange Function

Copy all elements of the specified arrayArrayThe end of the object. Array. addrange (array, items );

VaR A = ['A', 'B', 'C', 'D'];
VaR B = ['F', 'G', 'H'];
Array. addrange (A, B );

Array. Clear Function

SlaveArrayRemoves all elements from an object. Array. Clear (array );

Array. Clone Function

CreateArrayA superficial copy of an object. VaR clonevar = array. Clone (array );

Array. Contains Function

Determine whether an element is inArrayObject, return bool type. VaR itemexists = array. Contains (array, item );

Array. dequeue Function

SlaveArrayRemoves the first element from the object. VaR firstelement = array. dequeue (array );

Array. enqueue Function

Add an elementArrayThe end of the object. Array. enqueue (array, item );

Array. foreach Function

PairArrayEach element of the object performs the specified operation. Array. foreach (array, method, context );

VaR A = ['A', 'B', 'C', 'D'];
A [5] = 'E ';
VaR result = '';

Function appendtostring (element, index, array ){
// "This" is the context parameter, I. e. '| '.
Result + = element + This + index + ',';
}
Array. foreach (A, appendtostring, '| ');
// View the results: A | 0, B | 1, C | 2, d | 3, E | 5,
Alert (result );

Array. indexof Function

SearchArrayThe specified element of the object and the index of the element is returned. VaR indexvar = array. indexof (array, item, start );

Array. Insert Function

InArrayInsert a value at a specified position in the object. Array. insert (array, index, item );

Array. parse function

Create from string representationArrayObject. VaR A = array. parse (value );

The parse function fills the current array by splitting the string in the value. The format of the string in value must be "['item1', 'item2', 'item3']", and must contain quotation marks.

Array. Remove Function

RemoveArrayThe first match of an element in the object. VaR isremoved = array. Remove (array, item );

Return bool type, whether it has been removed.

Array. removeat Function

RemoveArrayThe element at the specified position in the object. Array. removeat (array, index );

  Boolean Type Extension

Name

Description

Boolean. parse function

Converts the string representation of the logical value to its Boolean equivalent object.

  Date Type Extension

Name

Description

Date. Format Function

Set the date format using a fixed (irrelevant to a specific region.

Date. localeformat Function

Use the current culture to set a specific string creation date based on a region.

Date. parselocale Function

Use the current culture to set a specific string creation date based on a region.

Date. parseinvariant Function

Use a fixed culture to create a date based on the string.

 

Error Type Extension

Name

Description

Error. argument function

CreateErrorObject, which indicates that SYS. argumentexception is abnormal.

Error. argumentnull Function

CreateErrorObject, which indicates that SYS. argumentnullexception is abnormal.

Error. argumentoutofrange Function

CreateErrorObject, which indicates that SYS. argumentoutofrangeexception is abnormal.

Error. argumenttype Function

CreateErrorObject, which indicates that SYS. argumenttypeexception is abnormal.

Error. argumentundefined Function

CreateErrorObject, which indicates that SYS. argumentundefinedexception is abnormal.

Error. Create Function

CreateErrorObject, which contains optional error information.

Error. Format Function

Create an error object that indicates a sys. formatexception exception.

Error. invalidoperation Function

CreateErrorObject, which indicates that SYS. invalidoperationexception is abnormal.

Error. Message Field

Indicates the description of the error.

Error. Name field

Indicates the name used to identify the error.

Error. notimplemented Function

CreateErrorObject, which indicates that SYS. notimplementedexception is abnormal.

Error. parametercount Function

CreateErrorObject, which indicates that SYS. parametercountexception is abnormal.

Error. popstackframe Function

UpdateErrorInstanceFilenameAndLinenumberAttribute to indicate the location where the error is triggered, rather than the location where the error is created. Use this function to create a custom error type.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.