Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebazhanov committed Feb 12, 2022
1 parent 9c4c6ef commit 9089e87
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
46 changes: 25 additions & 21 deletions javascript/javascript-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ for (var j = 1; j <= 4; j++) {
}
```

[Reference setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout)
[Reference immediately invoked anonymous functions](https://www.javascripttutorial.net/javascript-anonymous-functions/)
1. [Reference setTimeout](https://developer.mozilla.org/en-US/docs/Web/API/setTimeout)
2. [Reference immediately invoked anonymous functions](https://www.javascripttutorial.net/javascript-anonymous-functions/)

#### Q9. How does a function create a closure?

Expand Down Expand Up @@ -221,8 +221,8 @@ NOTE: The first three are all partially correct and will match digits, but the *

**More resources:**

- [Repeating characters](https://regexone.com/lesson/repeating_characters)
- [Kleene operators](https://regexone.com/lesson/kleene_operators)
1. [Repeating characters](https://regexone.com/lesson/repeating_characters)
2. [Kleene operators](https://regexone.com/lesson/kleene_operators)

#### Q13. What is the result in the console of running this code?

Expand Down Expand Up @@ -1033,8 +1033,8 @@ const foo = {
- [ ] Functions cannot be declared as properties of objects.
- [x] Nothing, there are no errors.
[Reference functions in javascript](https://www.w3schools.com/js/js_functions.asp)
[Reference working with objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects)
1. [Reference functions in javascript](https://www.w3schools.com/js/js_functions.asp)
2. [Reference working with objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects)
#### Q82. What will be logged to the console?
Expand Down Expand Up @@ -1111,8 +1111,8 @@ const foo = {
- [x] The map() methods returns a new array with a transformation applied on each item in the original array, wheras the `forEach()` method iterates through an array with noreturn value.
- [ ] The `forEach()` methods returns a new array with a transformation applied on each item in the original array, wheras the `map()` method iterates through an array with noreturn value.
[Reference map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
[Reference Differences between forEach and for loop](https://www.geeksforgeeks.org/difference-between-foreach-and-for-loop-in-javascript/)
1. [Reference map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
2. [Reference Differences between forEach and for loop](https://www.geeksforgeeks.org/difference-between-foreach-and-for-loop-in-javascript/)
#### Q86. Which concept does this code illustrate?
Expand Down Expand Up @@ -1379,9 +1379,9 @@ function roar() {
- [x] `roar.apply(bear);`
- [ ] `bear[roar]();`
[Reference Apply](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply)
[Reference this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this)
[Reference bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind)
1. [Reference Apply](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply)
2. [Reference this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this)
3. [Reference bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind)
#### Q104. Which choice is a valid example of an arrow function, assuming c is defined in the outer scope?
Expand Down Expand Up @@ -1504,8 +1504,8 @@ document.querySelectorAll('div').forEach((e) => {
- [ ] C
- [ ] A B C
[Reference query selector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector)
[Reference events](https://developer.mozilla.org/en-US/docs/Web/Events)
1. [Reference query selector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector)
2. [Reference events](https://developer.mozilla.org/en-US/docs/Web/Events)
#### Q113. What will this code log to the console?
Expand Down Expand Up @@ -1588,15 +1588,17 @@ for (let value of cipherText) {
}
```
[Reference MDN JavaScript Destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)
[Reference MDN JavaScript Array entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries)
[Reference MDN JavaScript Remainder/Modulo](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder)
1. [Reference MDN JavaScript Destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)
2. [Reference MDN JavaScript Array entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries)
3. [Reference MDN JavaScript Remainder/Modulo](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder)
#### Q116. What will this code log to the console?
```js
const foo = [1, 2, 3];
const [n] = foo;
console.log(n);
```
- [ ] undefined
- [x] 1
Expand All @@ -1605,9 +1607,11 @@ console.log(n);
#### Q117. Which Pokemon will be logged to the console?
var pokedex = ["Snorlax", "Jigglypuff", "Charmander", "Squirtle"];
```js
var pokedex = ['Snorlax', 'Jigglypuff', 'Charmander', 'Squirtle'];
pokedex.pop();
console.log(pokedex.pop());
```
- [x] Charmander
- [ ] Jigglypuff
Expand Down Expand Up @@ -1644,7 +1648,7 @@ if(/* Snippet goes here */){
</div>
```
- [ ] document.querySelector("div.content")
- [X] document.querySelector("span.content")
- [ ] document.querySelector(".content")
- [ ] document.querySelector("div.span")
- [ ] document.querySelector("div.content")
- [x] document.querySelector("span.content")
- [ ] document.querySelector(".content")
- [ ] document.querySelector("div.span")
14 changes: 7 additions & 7 deletions json/json-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
["red", "blue", "green"]
```

- [_]
- [ ]

```json
["red", "blue", "green"]
```

- [X]
- [x]

```json
{
Expand Down Expand Up @@ -307,10 +307,10 @@

#### Q22. Which is an invalid JSON value?

- [ ] "'|=(_)(X 72(_)|\/||\*'"
- [ ] "|=(_)(X 72(_)|\/||\*"
- [ ] "|=(_)(X\" \"72(_)|\/||\*"
- [x] "\s(_)(X 72(_)|\/||\*"
- [ ] `"'|=(_)(X 72(_)|\/||\*'"`
- [ ] `"|=(_)(X 72(_)|\/||\*"`
- [ ] `"|=(_)(X\" \"72(_)|\/||\*"`
- [x] `"\s(_)(X 72(_)|\/||\*"`

#### Q23. How do you encode a date in JSON?

Expand Down Expand Up @@ -394,7 +394,7 @@ null
- [ ] `constant: 6.022E23`
- [ ] `constant: "6.022E23"`

Explanation: Scientific Notation is a valid JSON number. You can use `e` or `E`. [(Reference)](https://json-schema.org/understanding-json-schema/reference/numeric.html)
[Reference](https://json-schema.org/understanding-json-schema/reference/numeric.html) **Explanation**: Scientific Notation is a valid JSON number. You can use `e` or `E`.

#### Q29. Which element is added to the DOM to create a JSON-P request?

Expand Down

0 comments on commit 9089e87

Please sign in to comment.