![Page 1: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/1.jpg)
What if your brain were ~*literally*~ JavaScript?
Jenna Zeigen RejectJS 2015
![Page 2: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/2.jpg)
zeigenvector
Engineering Manager @ DigitalOcean
![Page 4: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/4.jpg)
Human JavaScript
![Page 5: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/5.jpg)
¯\_(ツ)_/¯ ヽ(*‿*)ノ
![Page 6: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/6.jpg)
Language& Imagery& Perception& Thinking& Concepts& Categories& Memory& Attention& Judgement& Reasoning& Decision Making& Consciousness…
![Page 7: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/7.jpg)
Language& Imagery& Perception& Thinking& Concepts& Categories& Memory& Attention& Judgement& Reasoning& Decision Making& Consciousness…
![Page 8: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/8.jpg)
1. Human Language vs. Programming Languages
2. Human Concepts + Categories vs. JavaScript Prototypes + Primitives
3. Human Attention vs. the JavaScript event loop
![Page 9: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/9.jpg)
Language
![Page 10: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/10.jpg)
Language
natural language vs. programming language
• regulation • evolution • learning
![Page 11: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/11.jpg)
Language
Programming languages
create and manipulate the environment, rather than just describe it.
![Page 12: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/12.jpg)
Language
Humans JavaScript
syntax
semantics
morphology
phonology
pragmatics
![Page 13: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/13.jpg)
Language
Humans JavaScript
syntax
semantics
morphology
phonology
pragmatics
![Page 14: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/14.jpg)
Language
Humans JavaScript
syntax
semantics
morphology
phonology
pragmatics
![Page 15: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/15.jpg)
Language
context.
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-syntactic-and-lexical-grammars
![Page 16: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/16.jpg)
Language
“I saw the unicorn with the
binoculars.”
![Page 17: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/17.jpg)
Language
“I saw the unicorn with the
binoculars.”
![Page 18: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/18.jpg)
Language
context.
![Page 19: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/19.jpg)
Language
https://en.wikipedia.org/wiki/Anaphora_(linguistics)
Reference: pronouns + variables
![Page 20: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/20.jpg)
Anaphora: “Jenna gave a talk on the cognitive science of JavaScript, and she totally rocked it.”
sheit
talkJenna
Language
![Page 21: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/21.jpg)
Cataphora: “Since she was there last year, Jenna was excited to visit Berlin.”Berlin
she there Jenna
Language
![Page 22: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/22.jpg)
Language
![Page 23: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/23.jpg)
Language
Reference: pronouns + JavaScript’s this
![Page 24: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/24.jpg)
Language
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-error-handling-and-language-extensions
![Page 25: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/25.jpg)
Language
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-error-handling-and-language-extensions
![Page 26: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/26.jpg)
Concepts + Categories
![Page 27: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/27.jpg)
“knowledge representation”
Concepts + Categories
![Page 28: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/28.jpg)
http://www.photogalaxy.com/pic/eventhorizon-20/yorkie_puppy.jpg
Concepts + Categories
![Page 29: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/29.jpg)
http://www.photogalaxy.com/pic/eventhorizon-20/yorkie_puppy.jpg
Concepts + Categories
![Page 30: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/30.jpg)
Concepts + Categories
classical vs.
prototypal (inheritance)
classical vs.
prototype (categorization theories)
![Page 31: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/31.jpg)
Concepts + Categories
classical vs.
prototypal (inheritance)
classical vs.
prototype (categorization theories)
coincidence? ¯\_(ツ)_/¯
![Page 32: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/32.jpg)
Concepts + Categories“In a computer system designed for the storage of semantic information, it is more economical to store generalized information with superset nodes, rather than with all the individual nodes to which such a generalization might apply. But such a storage system incurs the cost of additional processing time in retrieving the information. When the implications of such a model were tested for human [subjects] using well-ordered hierarchies that are part of the common culture, there was a substantial agreement between the predictions and the data.”
(Collins & Quillian, 1969)
![Page 33: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/33.jpg)
Animal
Bird Fish
Canary Ostrich Shark Salmon
• Has skin • Can move around • Eats • Breathes
• Has fins • Can swim • Has gills
• Has wings • Can fly • Has feathers
• Can sing • Is yellow
• Has long, thin legs • Is tall • Can’t fly
• Can bite • Is dangerous
• Is pink • Is edible • Swims upstream to
lay eggs
Collins & Quillian, 1969
![Page 34: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/34.jpg)
Animal
Bird Fish
Canary Ostrich Shark Salmon
• Has skin • Can move around • Eats • Breathes
• Has fins • Can swim • Has gills
• Has wings • Can fly • Has feathers
• Can sing • Is yellow
• Has long, thin legs • Is tall • Can’t fly
• Can bite • Is dangerous
• Is pink • Is edible • Swims upstream to
lay eggs
Collins & Quillian, 1969
Is a canary a bird?
![Page 35: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/35.jpg)
Animal
Bird Fish
Canary Ostrich Shark Salmon
• Has skin • Can move around • Eats • Breathes
• Has fins • Can swim • Has gills
• Has wings • Can fly • Has feathers
• Can sing • Is yellow
• Has long, thin legs • Is tall • Can’t fly
• Can bite • Is dangerous
• Is pink • Is edible • Swims upstream to
lay eggs
Collins & Quillian, 1969
Is a canary an animal?
![Page 36: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/36.jpg)
Animal
Bird Fish
Canary Ostrich Shark Salmon
• Has skin • Can move around • Eats • Breathes
• Has fins • Can swim • Has gills
• Has wings • Can fly • Has feathers
• Can sing • Is yellow
• Has long, thin legs • Is tall • Can’t fly
• Can bite • Is dangerous
• Is pink • Is edible • Swims upstream to
lay eggs
Collins & Quillian, 1969
Is a canary yellow?
![Page 37: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/37.jpg)
Animal
Bird Fish
Canary Ostrich Shark Salmon
• Has skin • Can move around • Eats • Breathes
• Has fins • Can swim • Has gills
• Has wings • Can fly • Has feathers
• Can sing • Is yellow
• Has long, thin legs • Is tall • Can’t fly
• Can bite • Is dangerous
• Is pink • Is edible • Swims upstream to
lay eggs
Collins & Quillian, 1969
Does a canary breathe?
![Page 38: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/38.jpg)
Concepts + Categories
Is a shark a fish?
![Page 39: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/39.jpg)
Concepts + Categories
Prototype theory (Rosch, 1973):
• we store an average ideal representation of a category
Exemplar theory
• we store an instance of a category that is a combination of all experienced exemplars
![Page 40: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/40.jpg)
Concepts + Categories
Basic Level Categories: A “natural” level of categorization
![Page 41: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/41.jpg)
Animal
Canary Ostrich Shark Salmon
• Has skin • Can move around • Eats • Breathes
• Has fins • Can swim • Has gills
• Has wings • Can fly • Has feathers
• Can sing • Is yellow
• Has long, thin legs • Is tall • Can’t fly
• Can bite • Is dangerous
• Is pink • Is edible • Swims upstream to
lay eggs
Collins & Quillian, 1969
Bird Fish
![Page 42: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/42.jpg)
Concepts + Categories
Basic Level Categories: ECMAScript language types? (Boolean, Null, Undefined, Number, String, Symbol)
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ecmascript-data-types-and-values
![Page 43: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/43.jpg)
Concepts + Categories
Basic Level Categories: ECMAScript language types? (Boolean, Null, Undefined, Number, String, Symbol)
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ecmascript-data-types-and-values
![Page 44: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/44.jpg)
Concepts + Categories
Basic Level Categories: ECMAScript types? (Boolean, Null, Undefined, Number, String, Symbol)
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ecmascript-data-types-and-values
![Page 45: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/45.jpg)
Concepts + Categories
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ecmascript-data-types-and-values
Basic Level Categories: But what about Arrays? Functions? Dates? Promises?
![Page 46: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/46.jpg)
Concepts + Categories
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ecmascript-data-types-and-values
“Well-Known Intrinsic Objects”
Basic Level Categories: But what about Arrays? Functions? Dates? Promises?
![Page 47: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/47.jpg)
![Page 48: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/48.jpg)
Attention
![Page 49: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/49.jpg)
Attention
• attention as a filter • attention as a spotlight • attention as glue • attention as control
![Page 50: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/50.jpg)
Attention
blue green red orange
![Page 51: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/51.jpg)
Attention
• attention as a filter • attention as a spotlight • attention as glue • attention as control
![Page 52: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/52.jpg)
Attention
Attention as threads!
• attention as a filter • attention as a spotlight • attention as glue • attention as control
![Page 53: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/53.jpg)
Attention
Humans are pretty bad at multitasking: • inattentional blindness • dichotic listening task • shadowing
(Simons, 1999; Cherry, 1953; Triesman, 1964; Allport et al., 1972 )
![Page 54: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/54.jpg)
Attention
(Simons, 1999; Cherry, 1953; Triesman, 1964; Allport et al., 1972 )
“These are the words you aren’t supposed to be listening to.”
“These are the words you need to repeat back.”
“These are the words you need to repeat back.”
![Page 55: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/55.jpg)
Attention
(Simons, 1999; Cherry, 1953; Triesman, 1964; Allport et al., 1972 )
“These are the words you need to repeat back.”
“Words these are the aren’t supposed to you be to listening.”
“These are the words you need to repeat back.”
![Page 56: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/56.jpg)
Attention
(Simons, 1999; Cherry, 1953; Triesman, 1964; Allport et al., 1972 )
“These are the words you need to repeat back.”
![Page 57: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/57.jpg)
Attention
(Simons, 1999; Cherry, 1953; Triesman, 1964; Allport et al., 1972 )
DOG“These are the words you need to repeat back.”
![Page 58: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/58.jpg)
Attention
(Simons, 1999; Cherry, 1953; Triesman, 1964; Allport et al., 1972 )
“dog”
“These are the words you need to repeat back.”
![Page 59: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/59.jpg)
Attention
Humans are pretty bad at multitasking: • inattentional blindness • dichotic listening task • shadowing
task-specific resources
(Simons, 1999; Cherry, 1953; Triesman, 1964; Allport et al., 1972 )
![Page 60: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/60.jpg)
Attention
JavaScript does not multitask. • single-threaded • non-blocking • asynchronous
![Page 61: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/61.jpg)
![Page 63: What if your brain were ~*literally*~ JavaScript?](https://reader034.vdocuments.site/reader034/viewer/2022051520/627f52a3f0afce01880d9f30/html5/thumbnails/63.jpg)
Thanks!
Me, @zeigenvector