SlideShare a Scribd company logo
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
Question 1: Panama hats
Q: In which country were Panama hats originally made?
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.
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.
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
Question 3: Canary Islands
Q: After which creature were the Canary Islands named?
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.
Question 4: Assignment assigns
js> words = ’Call me Ishmael.’
Call me Ishmael.
js> words.lang = ’en’
js> lang = words.lang // What is lang?
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
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?
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
Question 5: King George
Q: What was the first name of Britain’s King George VI?
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.
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
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’?
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
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
Question 7: White rhinocerous
Q: What is the colour of a white rhinocerous?
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’.
Question 8: False is false
js> true ? 1 : 0
1
js> false ? 1 : 0
0
Question 8: False is false
js> true ? 1 : 0
1
js> false ? 1 : 0
0
js> new Boolean(false) ? 1 : 0 // Question
Question 8: False is false
js> true ? 1 : 0
1
js> false ? 1 : 0
0
js> new Boolean(false) ? 1 : 0 // Question
1
Question 8: False is false
js> true ? 1 : 0
1
js> false ? 1 : 0
0
js> new Boolean(false) ? 1 : 0 // Question
1
js> Boolean(false) ? 1 : 0
Question 8: False is false
js> true ? 1 : 0
1
js> false ? 1 : 0
0
js> new Boolean(false) ? 1 : 0 // Question
1
js> Boolean(false) ? 1 : 0
0
Question 9: Black box
Q: What colour is the black box flight recorder carried by
commercial planes?
Question 9: Black box
Q: What colour is the black box flight recorder carried by
commercial planes?
A: Orange.
This makes it more visible.
Question 10: Like JavaScript
Q: JavaScript is not like which programming language . . .
Question 10: Like JavaScript
Q: JavaScript is not like which programming language . . .
. . . created by Sun?
Question 10: Like JavaScript
Q: JavaScript is not like which programming language . . .
. . . created by Sun?
A: Java.
Thank you

More Related Content

More from Jonathan Fine

A personal history of UK TUG
A personal history of UK TUGA personal history of UK TUG
A personal history of UK TUG
Jonathan Fine
 
Access and Accessibility
Access and AccessibilityAccess and Accessibility
Access and Accessibility
Jonathan Fine
 
Portable TeX Documents (PTD): PackagingCon 2021
Portable TeX Documents (PTD): PackagingCon 2021Portable TeX Documents (PTD): PackagingCon 2021
Portable TeX Documents (PTD): PackagingCon 2021
Jonathan Fine
 
Browse and print: Problems and Solutions
Browse and print: Problems and SolutionsBrowse and print: Problems and Solutions
Browse and print: Problems and Solutions
Jonathan Fine
 
Online Python Resources
Online Python ResourcesOnline Python Resources
Online Python Resources
Jonathan Fine
 
Writing tests
Writing testsWriting tests
Writing tests
Jonathan Fine
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 

More from Jonathan Fine (7)

A personal history of UK TUG
A personal history of UK TUGA personal history of UK TUG
A personal history of UK TUG
 
Access and Accessibility
Access and AccessibilityAccess and Accessibility
Access and Accessibility
 
Portable TeX Documents (PTD): PackagingCon 2021
Portable TeX Documents (PTD): PackagingCon 2021Portable TeX Documents (PTD): PackagingCon 2021
Portable TeX Documents (PTD): PackagingCon 2021
 
Browse and print: Problems and Solutions
Browse and print: Problems and SolutionsBrowse and print: Problems and Solutions
Browse and print: Problems and Solutions
 
Online Python Resources
Online Python ResourcesOnline Python Resources
Online Python Resources
 
Writing tests
Writing testsWriting tests
Writing tests
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
 

Recently uploaded

Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
cuobya
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
bseovas
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
saathvikreddy2003
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
zyfovom
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
ukwwuq
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
uehowe
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
AanSulistiyo
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 

Recently uploaded (20)

Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
办理毕业证(NYU毕业证)纽约大学毕业证成绩单官方原版办理
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 

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’.
  • 20. Question 8: False is false js> true ? 1 : 0 1 js> false ? 1 : 0 0
  • 21. Question 8: False is false js> true ? 1 : 0 1 js> false ? 1 : 0 0 js> new Boolean(false) ? 1 : 0 // Question
  • 22. Question 8: False is false js> true ? 1 : 0 1 js> false ? 1 : 0 0 js> new Boolean(false) ? 1 : 0 // Question 1
  • 23. Question 8: False is false js> true ? 1 : 0 1 js> false ? 1 : 0 0 js> new Boolean(false) ? 1 : 0 // Question 1 js> Boolean(false) ? 1 : 0
  • 24. Question 8: False is false js> true ? 1 : 0 1 js> false ? 1 : 0 0 js> new Boolean(false) ? 1 : 0 // Question 1 js> Boolean(false) ? 1 : 0 0
  • 25. Question 9: Black box Q: What colour is the black box flight recorder carried by commercial planes?
  • 26. Question 9: Black box Q: What colour is the black box flight recorder carried by commercial planes? A: Orange. This makes it more visible.
  • 27. Question 10: Like JavaScript Q: JavaScript is not like which programming language . . .
  • 28. Question 10: Like JavaScript Q: JavaScript is not like which programming language . . . . . . created by Sun?
  • 29. Question 10: Like JavaScript Q: JavaScript is not like which programming language . . . . . . created by Sun? A: Java.