union | |||||||||||||
Type | command | ||||||||||||
Dictionary | LCS | ||||||||||||
Library | LiveCode Script | ||||||||||||
Syntax |
| ||||||||||||
Summary | Combines two arrays. | ||||||||||||
Introduced | 1.1 | ||||||||||||
Changes | The | ||||||||||||
OS | mac, windows, linux, ios, android | ||||||||||||
Platforms | desktop, server, mobile | ||||||||||||
Parameters |
| ||||||||||||
Example |
| ||||||||||||
Related | Keyword: element Operator: + Command: add, intersect, difference, symmetric difference Function: keys Glossary: element, key, command, array, execute | ||||||||||||
Description | Use the union command to combine two arrays, eliminating duplicate elements. The recursively adverb controls whether the intersection recurses through nested arrays or not. The union command combines targetArray and templateArray. Each key of targetArray is checked to see whether there is already an element with that key in templateArray. If there is, that element of targetArray is unchanged. If not, the corresponding element of the templateArray is placed in targetArray. After the union command is executed, the keys of targetArray consists of the logical union of the keys of the original targetArray and the keys of templateArray. The content of individual elements of the templateArray does not control the final result. Only which elements exist in the templateArray, not their content, controls which elements of the templateArray are placed in targetArray. If targetArray and templateArray have the same set of keys but different content in each element, the union command does not change the value of targetArray. If the into clause is used the operation of the commands is the same as the non-into form except that targetArray does not have to be a variable, and the result of the operation is placed into destinationArray rather than mutating targetArray. | ||||||||||||
Tags | properties |