Skip to content

Commit ca601be

Browse files
committed
New: Simple eval example.
1 parent fe1bc4f commit ca601be

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

basic/eval.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
console.log(eval('2 + 2'));
2+
// Expected output: 4
3+
4+
console.log(eval(new String('2 + 2')));
5+
// Expected output: 2 + 2
6+
7+
console.log(eval('2 + 2') === eval('4'));
8+
// Expected output: true
9+
10+
console.log(eval('2 + 2') === eval(new String('2 + 2')));
11+
// Expected output: false

0 commit comments

Comments
 (0)