Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
JavaScript Type Conversions
Search
Orlando Del Aguila
March 13, 2015
Programming
1
67
JavaScript Type Conversions
JavaScript Type Conversions and some explanations to the Gary Bernhardt's wat lighting talk
Orlando Del Aguila
March 13, 2015
Tweet
Share
More Decks by Orlando Del Aguila
See All by Orlando Del Aguila
Open Source + Nonprofits = 💪
orlando
0
98
Web APIs 2019
orlando
0
150
Managing remote teams
orlando
0
72
How to be a Senior Software Engineer
orlando
0
150
Terraform Workshop
orlando
1
170
Infrastructure as Code with Terraform
orlando
0
310
Concurrencia, Paralelismo y el Event-loop
orlando
0
380
Talking Web Apps
orlando
0
120
Web Launchpad - Chelajs
orlando
0
240
Other Decks in Programming
See All in Programming
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
170
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
250
Basic Architectures
denyspoltorak
0
660
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
20
6.8k
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
170
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
組織で育むオブザーバビリティ
ryota_hnk
0
170
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
960
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
AgentCoreとHuman in the Loop
har1101
5
220
Featured
See All Featured
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
49k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
88
Google's AI Overviews - The New Search
badams
0
900
Making Projects Easy
brettharned
120
6.6k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
100
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
The Curse of the Amulet
leimatthew05
1
8.3k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Raft: Consensus for Rubyists
vanstee
141
7.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
300
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
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