Scope/Function names and labels: Difference between revisions

m
mNo edit summary
m (→‎{{header|Wren}}: Minor tidy)
 
Line 1,286:
 
The following example illustrates these points.
<syntaxhighlight lang="ecmascriptwren">//func.call() /* invalid, can't call func before its declared */
 
var func = Fn.new { System.print("func has been called.") }
Line 1,308:
 
(with line 1 uncommented)
[./scope_function_namesScope_Function_names_and_labels line 3] Error at '}': Variable 'func' referenced before this definition (first use at line 1).
 
(with only line 7 uncommented)
func has been called.
Null does not implement 'init()'.
[./scope_function_namesScope_Function_names_and_labels line 7] in (script)
</pre>
 
9,476

edits