Skip to content

Commit

Permalink
resolve issue Ebazhanov#2856 and issue Ebazhanov#2842 (Ebazhanov#2872)
Browse files Browse the repository at this point in the history
  • Loading branch information
GalexyN authored Dec 28, 2021
1 parent fd1017f commit b9ae177
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 7 deletions.
61 changes: 57 additions & 4 deletions javascript/javascript-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ seconds.type = 'fruit';
**Explanation:** https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
#### Q91. What will be logged to the console?
#### Q91. What will be logged to the console??
```js
'use strict';
Expand All @@ -1034,14 +1034,14 @@ new logThis();
- [ ] function
- [x] {desc: "logger"}
#### Q92. Which statement is applicable to the defer attribute af the HTML <script> tag?
#### Q92. Which statement is applicable to the defer attribute of the HTML \<script\> tag?
- [ ] defer causes the script ta be loaded from the backup content delivery network (CDN).
- [x] defer allows the browser ta continue processing the page while the script loads in the background.
- [ ] defer blacks the browser from processing HTML below the tag until the script is completely loaded.
- [ ] defer lazy loads the script, causing it to download only when it is called by another script on the page.
**Explanation:** If the defer attribute is set, it specifies that the script is downloaded in parallel to parsing the page, and executed after the page has finished parsing. [HTML <script> defer Attribute](https://www.w3schools.com/tags/att_script_defer.asp)
**Explanation:** If the defer attribute is set, it specifies that the script is downloaded in parallel to parsing the page, and executed after the page has finished parsing. [HTML \<script\> defer Attribute](https://www.w3schools.com/tags/att_script_defer.asp)
#### Q93. What will this code print?
Expand Down Expand Up @@ -1281,7 +1281,8 @@ document.querySelectorAll('div').forEach((e) => {
#### Q113. Which code would you use to access the Irish flag?
```javascript
```
javascript
var flagsJSON =
'{ "countries" : [' +
'{ "country":"Ireland" , "flag":"🇮🇪" },' +
Expand All @@ -1294,3 +1295,55 @@ var flagDatabase = JSON.parse(flagsJSON);
- [ ] flagDatabase.countries[1].flag
- [ ] flagsJSON.countries[0].flag
- [ ] flagDatabase[1].flag
### Q114. Which statement prints "roar" to the console?
```
var sound = "grunt";
var bear = {
sound: "roar"
};
function roar() {
console.log(this.sound);
}
```
- [ ] `bear.bind(roar);`
- [ ] `roar.bind(bear);`
- [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)
### Q115. Which line could you add to this code to print "jaguar" to the console?
```
let animals = ["jaguar","eagle"];
//Missing Line
console.log(animals.pop()); //Prints jaguar
```
- [ ] `animals.filter(e => e === "jaguar");`
- [ ] `animals.reverse();`
- [ ] `animals.shift();`
- [x] `animals.pop();`
[Reference Javascript Array Reverse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse)
### Q116. Which snippet could you add to this code to print "food" to the console?
```
class Animal {
static belly = [];
eat () {
Animal.belly.push("food");
}
}
let a = new Animal();
a.eat();
console.log(/* Snippet Here */); //Prints food
```
- [ ] `a.prototype.belly[0]`
- [ ] `Object.getPrototype0f (a).belly[0]`
- [X] `Animal.belly[0]`
- [ ] `a.belly[0]`
[Reference Javascript Class static Keyword](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static)
20 changes: 17 additions & 3 deletions python/python-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -1430,9 +1430,6 @@ print(math.pow(2,10)) # prints 2 elevated to the 10th power
- [x] lists; dictionaries or sets; tuples

[Reference](https://www.geeksforgeeks.org/differences-and-applications-of-list-tuple-set-and-dictionary-in-python/)



#### Q107. What is the output of this code? (NumPy has been imported as np.)
```
table = np.array([
Expand Down Expand Up @@ -1468,5 +1465,22 @@ print (f"The number is {number}")
- [ ] `my_tuple = [2, 'apple', 3.5]`

[Reference](https://beginnersbook.com/2018/02/python-tuple/)
#### Q110. Which mode is _not_ a valid way to access a file from within a Python script?
- [ ] write('w')
- [ ] scan('s')
- [X] append('a')
- [ ] read('r')

[Reference](https://www.guru99.com/reading-and-writing-files-in-python.html)

[Reference](https://www.w3schools.com/python/ref_list_append.asp)
#### Q111. Which command will create a list from 10 down to 1? Example:
```
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
```
- [ ] reversed(list(range(1,11)))
- [X] list(reversed(range(1,10)))
- [ ] list(range(10, 1, -1))
- [ ] list(reversed(range(1,11)))

[Reference](https://www.programiz.com/python-programming/methods/built-in/reversed)

0 comments on commit b9ae177

Please sign in to comment.