Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 1. What is the outcome of the two alerts below?
- var foo = "Hello";
- (function() {
- var bar = " World";
- alert(foo + bar); // “Alert #1"
- })();
- alert(foo + bar); // “Alert #2"
- //==========================================
- //2. What is the difference between A and B:
- function Person() {
- this.firstname = “John”;
- this.lastname = “Doe”;
- };
- var person = Person(); // “Situation #1"
- var person = new Person(); // “Situation #2"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement