Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JavaScript Type Conversions
Search
Orlando Del Aguila
March 13, 2015
Programming
110
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JavaScript Type Conversions
JavaScript Type Conversions and some explanations to the Gary Bernhardt's wat lighting talk
Orlando Del Aguila
March 13, 2015
More Decks by Orlando Del Aguila
See All by Orlando Del Aguila
Open Source + Nonprofits = 💪
orlando
0
120
Web APIs 2019
orlando
0
170
Managing remote teams
orlando
0
88
How to be a Senior Software Engineer
orlando
0
170
Terraform Workshop
orlando
1
190
Infrastructure as Code with Terraform
orlando
0
340
Concurrencia, Paralelismo y el Event-loop
orlando
0
410
Talking Web Apps
orlando
0
150
Web Launchpad - Chelajs
orlando
0
260
Other Decks in Programming
See All in Programming
JRuby: Past, Present, and Future
headius
0
210
FreeBSDでZabbixを動かす
kenkino
0
330
Security issues being discussed on Web Platforms
petamoriken
0
1.3k
iOSDCのペンライトを自動制御したい!
akkeylab
0
100
Java 27新機能 / Java 27 new features
kishida
2
180
Are APIs Still Relevant in the AI Era?
soyuka
0
330
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
350
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
130
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
280
wkhtmltopdfの次どうするか問題2026
willnet
2
1.8k
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
160
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
740
Art, The Web, and Tiny UX
lynnandtonic
304
22k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
350
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
840
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
Designing Experiences People Love
moore
143
24k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
Docker and Python
trallard
47
4.2k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
720
Transcript
JavaScript Type Conversions
JavaScript Primitives yes, js has primitives
1. undefined 2. null 3. number 4. string 5. boolean
1. undefined 2. null yep, is not an object 3.
number 4. string 5. boolean
JavaScript Binary Operators we are going to address only -
and +
On doubt check the spec
http://www.ecma-international.org/ecma-262/5.1/#sec-11.6.1 http://www.ecma-international.org/ecma-262/5.1/#sec-11.6.2
+ Operator
If lprim or rprim are strings, then concatenate lprim and
rprim and return the result
- Operator
ToNumber(lprim) - ToNumber(rprim)
Examples
var a, b; a = "bla"; b = "ble"; a
+ b; //=> "blable" a - b; //=> "NaN" a = "5"; b = "4"; a + b; //=> "54" a - b; //=> 1
var obj = { valueOf: function valueOf() { console.log("valueOf"); return
{}; // not a primitive }, toString: function toString() { console.log("toString"); return {}; // not a primitive } }; obj - 1; // valueOf // toString // error obj + 1; // valueOf // toString // error
var func = function () { console.log('exec'); return { valueOf:
function valueOf() { console.log("valueOf"); return {}; // not a primitive }, toString: function toString() { console.log("toString"); return {}; // not a primitive } }; }; func() + 1; // exec // valueOf // toString // error
{} + [] //=> +[] == 0 [] + {}
//=> '' + '[object Object]' == '[object Object]' [] - {} //=> 0 - NaN == NaN {} - [] //=> -[] == -0
None
WAT https://www.destroyallsoftware.com/talks/wat