_satellite.each([array], [function], [context])

Please read Limitations before using this reference. The object was tested on August 4, 2016. Other _satellite objects are on DTM _satellite Object List.

 

Description

According to Dynamic Tag Management Object Reference PDF (2013),

“A method for array iteration without having to write a for-loop”.

This method is very similar to jQuery.each().

Object Type

  • function with parameters

Parameters

  • array: an array
  • function(item, index, arr): a function which accepts each item in the array once.
    It takes these arguments:
    – item: an item
    – index: the array index of designated item
    – arr: the array
  • context: the context to be bound to function when it is invoked

Return Value

  • none

JavaScript on Developer Console
The following codes were found when “_satellite.each” was typed on Developer Console.

 

Examples

Example 1
Iterate all <a> tags and display each <a> tag in console. [context] parameter is ignored.

Example 2
Iterate an array and a call back function with the arguments (item, index, arr)

Example 3
Iterate an array and display [context] parameter

References

Leave a Reply

Your email address will not be published. Required fields are marked *