Created
April 8, 2013 11:48
-
-
Save jbuda/5336245 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
colourArray = ["Red","Orange","Yellow","Green","Blue","Indigo","Violet"]; | |
colourArrayTwo = ["Yellow","Green","Red","Violet"]; | |
// duplicate one array as the result of retainAll remove the elements no present in both | |
// we want to keep the original array and return a new array | |
presentInBoth = duplicate(colourArray); | |
presentInBoth.retainAll(colourArrayTwo); | |
writeDump(presentInBoth); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment