Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var s1 = '2 + 2'; // creates a string primitive
- var s2 = new String('2 + 2'); // creates a String object
- console.log(eval(s1)); // returns the number 4
- console.log(eval(s2)); // returns the string "2 + 2"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement