uiwjs / react-textarea-code-editor

A simple code editor with syntax highlighting.
https://uiwjs.github.io/react-textarea-code-editor/
MIT License
476 stars 22 forks source link

How to run the code to get the result ? #132

Open pxim opened 1 year ago

pxim commented 1 year ago

NQ@~FV1M8R3_@2)~13Q$VVY

jaywcjlove commented 1 year ago

@pxim

Example 1

var code = 'console.log(123)';
var func = new Function(code)
func()

Example 2

var code = 'console.log(123)';
eval(code)

Example 3

var code = 'console.log(123)';
setTimeout(code)