This commit is contained in:
Hanzhang ma
2024-06-24 11:47:26 +02:00
parent d758882972
commit c797db0f36
5 changed files with 119 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script src="t.js"></script>
</body>
</html>

View File

@@ -0,0 +1,7 @@
let func = new Function('a', 'b', 'return a+b');
console.log(func(1,2))
let x = 10;
func = new Function('return x;');
console.log(func()); // Error: x is not defined