Jump to content

Runtime evaluation: Difference between revisions

Added JavaScript example
(Added JavaScript example)
Line 241:
 
two = loadstring"return ..." -- two() returns the arguments passed to it</lang>
 
=={{header|JavaScript}}==
The eval method handles statements and expressions well:
<lang javascript>
var foo = eval('{value: 42}');
eval('var bar = "Hello, world!";');
 
typeof foo; // 'object'
typeof bar; // 'string'
</lang>
 
=={{header|Oz}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.