Last active
November 26, 2019 14:53
-
-
Save ElectricImpSampleCode/23a9a81c5ae3a1929996 to your computer and use it in GitHub Desktop.
Squirrel array map() example
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
local anArray = [true, true, false, false, true]; | |
// Apply the data conversion function and save the result in a new array | |
local newArray = anArray.map(function(value) { | |
return !value; | |
}); | |
// newArray equals [false, false, true, true, false] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment