Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scope.md (to fix syntax errors in practice folder) #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions practice/scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ function sample() {
}
console.log(username);
}

sample();
```

21. Guess the output and the reason behind that.
Expand All @@ -231,6 +233,8 @@ function sample() {
}
console.log(username);
}

sample();
```

22. Guess the output and the reason behind that.
Expand All @@ -240,10 +244,12 @@ function sample() {
var username = "Arya Stark";
if (true) {
var username = "John Snow";
console.log(username);
console.log(username, "first");
}
console.log(username, "second");
}

sample();
```

23. Guess the output and the reason behind that.
Expand All @@ -257,6 +263,8 @@ function sample() {
}
console.log(username, "second");
}

sample();
```

24. Guess the output and the reason behind that.
Expand Down Expand Up @@ -304,7 +312,7 @@ if (true) {
function outer() {
let movie = "Mad Max: Fury Road";
function inner() {
console.log("I love this movie called ${movie.toUpperCase()}");
console.log(`I love this movie called ${movie.toUpperCase()}`);
}
inner();
}
Expand All @@ -319,7 +327,7 @@ function outer() {
let movie = "Mad Max: Fury Road";
function inner() {
let movie = "Before Sunrise";
console.log("I love this movie called ${movie.toUpperCase()}");
console.log(`I love this movie called ${movie.toUpperCase()}`);
}
inner();
}
Expand All @@ -336,7 +344,7 @@ function outer() {
let movie = "Before Sunrise";
function extraInner() {
let movie = "Gone Girl";
console.log("I love this movie called ${movie.toUpperCase()}");
console.log(`I love this movie called ${movie.toUpperCase()}`);
}
extraInner();
}
Expand All @@ -356,7 +364,7 @@ const sub = (a, b) => {
return a - b;
};
const multiply = (a, b) => {
return a + b;
return a * b;
};
const divide = (a, b) => {
return a / b;
Expand All @@ -375,7 +383,7 @@ const sub = (a, b) => {
return a - b;
};
const multiply = (a, b) => {
return a + b;
return a * b;
};
const divide = (a, b) => {
return a / b;
Expand Down