<foreach>
Last updated
Last updated
The <foreach>
element allows a VoiceXML application to iterate through an ECMAScript array and to execute the content contained within the <foreach>
element for each item in the array.
array
An ECMAScript expression that must evaluate to an array; otherwise, an error.semantic event is thrown.
item
The variable that stores each array item upon each iteration of the loop. A new variable will be declared if it is not already defined within the parent's scope.
Both “array” and “item” must be specified. Please refer to the for examples and detailed usage information for this tag.
The output of the above script would be:
Computer: Please select one of the following movies. Computer: The Godfather, High Fidelity, Raiders of The Lost Ark. Human: High Fidelity. Computer: You said High Fidelity.
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
, , , , , , , , ,