Variables are local by default

Run some MiniScript code right in your browser!

vowelsInWord = function(word) count = 0 for item in word if "aeiou".indexOf(item) != null then count = count+1 end for return count end function totalVowels = function(lst) count = 0 for item in lst count = count + vowelsInWord(item) end for return count end function print totalVowels( ["foo", "bar"] )

Help & Information