SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
Microsoft AJAX Library: Array Type Extensions
                                                                                                     Array.forEach (array, method, context)
Array.add (array, item)
                                                                                                     Performs a specified action on each element of an Array object. Skips elements in
Adds an element to the end of an Array object.
                                                                                                     the array that have a value of undefined.
var a = ['a','b','c','d'];
                                                                                                     var a = ['a', 'b', 'c', 'd'];
Array.add(a, 'e');
                                                                                                     a[5] = 'e';
// a = ['a','b','c','d','e']
                                                                                                     var result = '';
Array.addRange (array, items)                                                                        function appendToString(arrayElement, index, array) {
Copies all the elements of a specified Array object to the end of the array.                             // quot;thisquot; is the context parameter, i.e. '|'.
                                                                                                         result += arrayElement + this + index + ',';
var a = ['a', 'b', 'c', 'd', 'e'];
                                                                                                     }
var b = ['f', 'g','h'];
                                                                                                     Array.forEach(a, appendToString, '|');
Array.addRange(a, b);
                                                                                                     // result = a|0,b|1,c|2,d|3,e|4,
// a = ['a','b','c','d','e','f','g','h']

                                                                                                     Array.indexOf (array, item, start)
Array.clear (array)
                                                                                                     Searches for the specified element of an Array object and returns its index. If item
Removes all elements from an Array instance.
                                                                                                     is not found in the array, returns -1.
Array.clone (array)                                                                                  var a = ['red', 'blue', 'green', 'blue'];
Creates a shallow copy of an Array object.                                                           var myFirstIndex = Array.indexOf(a, quot;bluequot;);
                                                                                                     var mySecondIndex = Array.indexOf (a, quot;bluequot;, (myFirstIndex + 1));
                                                                                                     // myFirstIndex = 1, mySecondIndex = 3
Remarks
                                                                                                     Array.insert (array, index, item)
A shallow copy contains only the elements of the array, whether they are reference
                                                                                                     Inserts a single item into a specified index of an Array object.
types or value types. However, it does not contain the referenced objects. The
                                                                                                     var a = ['a', 'b', 'd', 'e'];
references in the new Array object point to the same objects as in the original
                                                                                                     Array.insert(a, 2, 'c');
Array object. In contrast, a deep copy of an Array object copies the elements and
                                                                                                     // a = ['a','b','c','d','e']
everything directly or indirectly referenced by the elements.
                                                                                                     Array.parse (value)
var a = ['a','b','c','d'];
var b = Array.clone(a);
                                                                                                     Creates an array from a string representation.
// b = ['a','b','c','d']
                                                                                                     var a = Array.parse (quot;['red', 'blue', 'green']quot;);
Array.contains (array, item)                                                                         // a[0] = 'red', a[1] = 'blue', a[2] = 'green'
Determines whether the specified object exists as an element in an Array object.
                                                                                                     Array.enqueue (array, item)
var a = ['red','green','blue','yellow'];
                                                                                                     Adds the specified object to the end of an Array object. See also Array.dequeue ().
var b = Array.contains(a, quot;redquot;);
// b = true
                                                                                                     Array.remove(array, item)
Array.dequeue (array)                                                                                Removes the first occurrence of the specified item from an Array object.
Removes the first element from the Array object and returns it.
                                                                                                     var a = ['a', 'b', 'c', 'd', 'e'];
var myArray = [],result = quot;quot;;                                                                        Array.remove(a, 'c');
Array.add(myArray, 'a');                                                                             // a = ['a','b','d','e']
Array.add(myArray, 'b');                                                                             Array.removeAt(a, 2);
Array.add(myArray, 'c');                                                                             // a = ['a','b','e']
Array.add(myArray, 'd');
result = Array.dequeue(myArray);                                                                     Array.removeAt(array, index)
// myArray = ['b','c', 'd'], result = 'a'
                                                                                                     Removes an element from an Array object at a specified index location.

  A function is static and is invoked without creating an instance of the object   Based on Microsoft AJAX Library 1.0 • Compiled by Milan Negovan • www.AspNetResources.com • Last update: 2007-01-24

Más contenido relacionado

La actualidad más candente

Lec 25 - arrays-strings
Lec 25 - arrays-stringsLec 25 - arrays-strings
Lec 25 - arrays-strings
Princess Sam
 
PHP Unit 4 arrays
PHP Unit 4 arraysPHP Unit 4 arrays
PHP Unit 4 arrays
Kumar
 
Collections In Java
Collections In JavaCollections In Java
Collections In Java
Binoj T E
 

La actualidad más candente (20)

Lec 25 - arrays-strings
Lec 25 - arrays-stringsLec 25 - arrays-strings
Lec 25 - arrays-strings
 
PHP Unit 4 arrays
PHP Unit 4 arraysPHP Unit 4 arrays
PHP Unit 4 arrays
 
Array lecture
Array lectureArray lecture
Array lecture
 
Collection and framework
Collection and frameworkCollection and framework
Collection and framework
 
20 ch22 collections
20 ch22 collections20 ch22 collections
20 ch22 collections
 
Arrays in python
Arrays in pythonArrays in python
Arrays in python
 
Collections in Java Notes
Collections in Java NotesCollections in Java Notes
Collections in Java Notes
 
Arrays in python
Arrays in pythonArrays in python
Arrays in python
 
Array in Java
Array in JavaArray in Java
Array in Java
 
Variables, expressions, standard types
 Variables, expressions, standard types  Variables, expressions, standard types
Variables, expressions, standard types
 
Collections In Java
Collections In JavaCollections In Java
Collections In Java
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Arrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | EdurekaArrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | Edureka
 
Google collections api an introduction
Google collections api   an introductionGoogle collections api   an introduction
Google collections api an introduction
 
Java Collection framework
Java Collection frameworkJava Collection framework
Java Collection framework
 
Java Collections Framework
Java Collections FrameworkJava Collections Framework
Java Collections Framework
 
Collections Api - Java
Collections Api - JavaCollections Api - Java
Collections Api - Java
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
 
5 collection framework
5 collection framework5 collection framework
5 collection framework
 
Java collections notes
Java collections notesJava collections notes
Java collections notes
 

Destacado (7)

PròXim Orient
PròXim OrientPròXim Orient
PròXim Orient
 
PròXim Orient
PròXim OrientPròXim Orient
PròXim Orient
 
Discapacidad auditiva
Discapacidad auditivaDiscapacidad auditiva
Discapacidad auditiva
 
PròXim Orient
PròXim OrientPròXim Orient
PròXim Orient
 
Modificada pueblos barbaros
Modificada pueblos barbarosModificada pueblos barbaros
Modificada pueblos barbaros
 
Ms Ajax Dom Element Class
Ms Ajax Dom Element ClassMs Ajax Dom Element Class
Ms Ajax Dom Element Class
 
Modificación de "diario de un perro"
Modificación de "diario de un perro"Modificación de "diario de un perro"
Modificación de "diario de un perro"
 

Similar a Ms Ajax Array Extensions

Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
ZahouAmel1
 
An introduction to property-based testing
An introduction to property-based testingAn introduction to property-based testing
An introduction to property-based testing
Vincent Pradeilles
 

Similar a Ms Ajax Array Extensions (20)

Java script arrays
Java script arraysJava script arrays
Java script arrays
 
JAVASCRIPT OBJECTS.pdf
JAVASCRIPT OBJECTS.pdfJAVASCRIPT OBJECTS.pdf
JAVASCRIPT OBJECTS.pdf
 
Intoduction to php arrays
Intoduction to php arraysIntoduction to php arrays
Intoduction to php arrays
 
ARRAY OPERATIONS.pptx
ARRAY OPERATIONS.pptxARRAY OPERATIONS.pptx
ARRAY OPERATIONS.pptx
 
Chap 3php array part 3
Chap 3php array part 3Chap 3php array part 3
Chap 3php array part 3
 
Chapter 2 wbp.pptx
Chapter 2 wbp.pptxChapter 2 wbp.pptx
Chapter 2 wbp.pptx
 
PHP Language Trivia
PHP Language TriviaPHP Language Trivia
PHP Language Trivia
 
Array properties
Array propertiesArray properties
Array properties
 
Php array
Php arrayPhp array
Php array
 
javascript-Array.ppsx
javascript-Array.ppsxjavascript-Array.ppsx
javascript-Array.ppsx
 
Java ArrayList Tutorial | Edureka
Java ArrayList Tutorial | EdurekaJava ArrayList Tutorial | Edureka
Java ArrayList Tutorial | Edureka
 
Lodash js
Lodash jsLodash js
Lodash js
 
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 5 array in PHP.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
List of all php array functions
List of all php array functionsList of all php array functions
List of all php array functions
 
Data Types and Processing in ES6
Data Types and Processing in ES6Data Types and Processing in ES6
Data Types and Processing in ES6
 
SlideSet_4_Arraysnew.pdf
SlideSet_4_Arraysnew.pdfSlideSet_4_Arraysnew.pdf
SlideSet_4_Arraysnew.pdf
 
Unit 2-Arrays.pptx
Unit 2-Arrays.pptxUnit 2-Arrays.pptx
Unit 2-Arrays.pptx
 
Arrays in php
Arrays in phpArrays in php
Arrays in php
 
An introduction to property-based testing
An introduction to property-based testingAn introduction to property-based testing
An introduction to property-based testing
 

Más de jason hu 金良胡 (20)

新员工培训
新员工培训新员工培训
新员工培训
 
Javascript 闭包
Javascript 闭包Javascript 闭包
Javascript 闭包
 
Windows Powershell En
Windows Powershell   EnWindows Powershell   En
Windows Powershell En
 
正则表达式
正则表达式正则表达式
正则表达式
 
Work In Japan
Work In JapanWork In Japan
Work In Japan
 
Linuxcommand
LinuxcommandLinuxcommand
Linuxcommand
 
Ubunturef
UbunturefUbunturef
Ubunturef
 
Asp.Net运行时
Asp.Net运行时Asp.Net运行时
Asp.Net运行时
 
Fwunixref
FwunixrefFwunixref
Fwunixref
 
X Query
X QueryX Query
X Query
 
Sql2005 Xml
Sql2005 XmlSql2005 Xml
Sql2005 Xml
 
Ms Ajax Dom Element Class
Ms Ajax Dom Element ClassMs Ajax Dom Element Class
Ms Ajax Dom Element Class
 
Ms Ajax Number And Error Extensions
Ms Ajax Number And Error ExtensionsMs Ajax Number And Error Extensions
Ms Ajax Number And Error Extensions
 
Ms Ajax Dom Event Class
Ms Ajax Dom Event ClassMs Ajax Dom Event Class
Ms Ajax Dom Event Class
 
Ms Ajax Date And Boolean Extensions
Ms Ajax Date And Boolean ExtensionsMs Ajax Date And Boolean Extensions
Ms Ajax Date And Boolean Extensions
 
Ms Ajax String And Object Extensions
Ms Ajax String And Object ExtensionsMs Ajax String And Object Extensions
Ms Ajax String And Object Extensions
 
Ext Js Events
Ext Js EventsExt Js Events
Ext Js Events
 
Ext Js Dom Navigation
Ext Js Dom NavigationExt Js Dom Navigation
Ext Js Dom Navigation
 
Ext Js Events
Ext Js EventsExt Js Events
Ext Js Events
 
Ext J S Observable
Ext J S ObservableExt J S Observable
Ext J S Observable
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

Ms Ajax Array Extensions

  • 1. Microsoft AJAX Library: Array Type Extensions Array.forEach (array, method, context) Array.add (array, item) Performs a specified action on each element of an Array object. Skips elements in Adds an element to the end of an Array object. the array that have a value of undefined. var a = ['a','b','c','d']; var a = ['a', 'b', 'c', 'd']; Array.add(a, 'e'); a[5] = 'e'; // a = ['a','b','c','d','e'] var result = ''; Array.addRange (array, items) function appendToString(arrayElement, index, array) { Copies all the elements of a specified Array object to the end of the array. // quot;thisquot; is the context parameter, i.e. '|'. result += arrayElement + this + index + ','; var a = ['a', 'b', 'c', 'd', 'e']; } var b = ['f', 'g','h']; Array.forEach(a, appendToString, '|'); Array.addRange(a, b); // result = a|0,b|1,c|2,d|3,e|4, // a = ['a','b','c','d','e','f','g','h'] Array.indexOf (array, item, start) Array.clear (array) Searches for the specified element of an Array object and returns its index. If item Removes all elements from an Array instance. is not found in the array, returns -1. Array.clone (array) var a = ['red', 'blue', 'green', 'blue']; Creates a shallow copy of an Array object. var myFirstIndex = Array.indexOf(a, quot;bluequot;); var mySecondIndex = Array.indexOf (a, quot;bluequot;, (myFirstIndex + 1)); // myFirstIndex = 1, mySecondIndex = 3 Remarks Array.insert (array, index, item) A shallow copy contains only the elements of the array, whether they are reference Inserts a single item into a specified index of an Array object. types or value types. However, it does not contain the referenced objects. The var a = ['a', 'b', 'd', 'e']; references in the new Array object point to the same objects as in the original Array.insert(a, 2, 'c'); Array object. In contrast, a deep copy of an Array object copies the elements and // a = ['a','b','c','d','e'] everything directly or indirectly referenced by the elements. Array.parse (value) var a = ['a','b','c','d']; var b = Array.clone(a); Creates an array from a string representation. // b = ['a','b','c','d'] var a = Array.parse (quot;['red', 'blue', 'green']quot;); Array.contains (array, item) // a[0] = 'red', a[1] = 'blue', a[2] = 'green' Determines whether the specified object exists as an element in an Array object. Array.enqueue (array, item) var a = ['red','green','blue','yellow']; Adds the specified object to the end of an Array object. See also Array.dequeue (). var b = Array.contains(a, quot;redquot;); // b = true Array.remove(array, item) Array.dequeue (array) Removes the first occurrence of the specified item from an Array object. Removes the first element from the Array object and returns it. var a = ['a', 'b', 'c', 'd', 'e']; var myArray = [],result = quot;quot;; Array.remove(a, 'c'); Array.add(myArray, 'a'); // a = ['a','b','d','e'] Array.add(myArray, 'b'); Array.removeAt(a, 2); Array.add(myArray, 'c'); // a = ['a','b','e'] Array.add(myArray, 'd'); result = Array.dequeue(myArray); Array.removeAt(array, index) // myArray = ['b','c', 'd'], result = 'a' Removes an element from an Array object at a specified index location. A function is static and is invoked without creating an instance of the object Based on Microsoft AJAX Library 1.0 • Compiled by Milan Negovan • www.AspNetResources.com • Last update: 2007-01-24