Last active
September 28, 2022 12:18
-
-
Save MarshySwamp/8d94e12597fe101451a5412bf8f3510f to your computer and use it in GitHub Desktop.
Functions, Functions, Functions!
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
function main() { | |
alert("This is a declared function and is invoked by calling it by name from suspend history."); | |
} | |
app.activeDocument.suspendHistory("Run script", "main()"); | |
// or | |
(function (){ | |
alert("This is an anonymous self-invoking function! Also known as an 'Immediately Invoked Function Expression' or (IIFE)."); | |
}()); | |
// or | |
main("parameter"); | |
function main(parName) { | |
alert("This is a declared function and is invoked by calling it by name. It also includes a passed " + parName + "!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment