Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Javascript: The easiest quiz in the world ever
1. The easiest quiz in the world
ever
Jonathan Fine, Open University, UK
EuroPython Lightning talk, 2010
Source for slides available at http://bitbucket.org/jfine
/javascript-for-python-programmers
.../tex/easiest-quiz-ever.tex
2. Question 1: Panama hats
Q: In which country were Panama hats originally made?
3. Question 1: Panama hats
Q: In which country were Panama hats originally made?
A: Ecuador.
Panama was a city in Ecuador before the creation of the Panama
Canal Zone and then the country Panama.
4. Question 2: Equality is transitive
Command line SpiderMonkey JavaScript interpreter:
easiest-quiz-ever$ js
js> a = ’0’
js> b = 0
js> c = ’’
js> a == b
true
js> b == c
true
js> a == c // Question.
5. Question 2: Equality is transitive
Command line SpiderMonkey JavaScript interpreter:
easiest-quiz-ever$ js
js> a = ’0’
js> b = 0
js> c = ’’
js> a == b
true
js> b == c
true
js> a == c // Question.
js> a == c
false
6. Question 3: Canary Islands
Q: After which creature were the Canary Islands named?
7. Question 3: Canary Islands
Q: After which creature were the Canary Islands named?
A: Dog (canine).
As I recall, there were many dog seals on one of the Canary Islands.
8. Question 4: Assignment assigns
js> words = ’Call me Ishmael.’
Call me Ishmael.
js> words.lang = ’en’
js> lang = words.lang // What is lang?
9. Question 4: Assignment assigns
js> words = ’Call me Ishmael.’
Call me Ishmael.
js> words.lang = ’en’
js> lang = words.lang // What is lang?
js> lang == undefined
true
10. Question 4: Assignment assigns
js> words = ’Call me Ishmael.’
Call me Ishmael.
js> words.lang = ’en’
js> lang = words.lang // What is lang?
js> lang == undefined
true
js> lang = words.lang = ’en’ // What is lang?
11. Question 4: Assignment assigns
js> words = ’Call me Ishmael.’
Call me Ishmael.
js> words.lang = ’en’
js> lang = words.lang // What is lang?
js> lang == undefined
true
js> lang = words.lang = ’en’ // What is lang?
js> lang
en
12. Question 5: King George
Q: What was the first name of Britain’s King George VI?
13. Question 5: King George
Q: What was the first name of Britain’s King George VI?
A: Albert.
He had several names, and Queen Victoria said she wanted her
beloved Albert to be the only English monarch of that name.
14. Question 6: Dot binds
js> a = [0, 1, 2]
0,1,2
js> a.push(3); a.push(4);
js> a
0,1,2,3,4
15. Question 6: Dot binds
js> a = [0, 1, 2]
0,1,2
js> a.push(3); a.push(4);
js> a
0,1,2,3,4
js> b = [0, 1, 2]
js> tmp = b.push
js> tmp(3); tmp(4); // What is ’b’?
16. Question 6: Dot binds
js> a = [0, 1, 2]
0,1,2
js> a.push(3); a.push(4);
js> a
0,1,2,3,4
js> b = [0, 1, 2]
js> tmp = b.push
js> tmp(3); tmp(4); // What is ’b’?
js> b
0,1,2
17. Question 6: Dot binds
js> a = [0, 1, 2]
0,1,2
js> a.push(3); a.push(4);
js> a
0,1,2,3,4
js> b = [0, 1, 2]
js> tmp = b.push
js> tmp(3); tmp(4); // What is ’b’?
js> b
0,1,2
js> [length, this[0], this[1]]
2,3,4
18. Question 7: White rhinocerous
Q: What is the colour of a white rhinocerous?
19. Question 7: White rhinocerous
Q: What is the colour of a white rhinocerous?
A: Grey.
The name is a corruption of the Dutch work for ‘wide’.