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
同じってなんだ?
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Hirofumi Horiuchi
September 27, 2021
40
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
同じってなんだ?
Hirofumi Horiuchi
September 27, 2021
More Decks by Hirofumi Horiuchi
See All by Hirofumi Horiuchi
Stimulusのはなし
h_reader
0
43
OSSを読んでみた?
h_reader
0
59
vue_js_composition_api
h_reader
0
71
秒速でリリースするWebアプリ.pdf
h_reader
0
53
はじめよう async/await
h_reader
0
55
Node.jsではじめるオレオレツールの世界
h_reader
0
520
Featured
See All Featured
The Language of Interfaces
destraynor
162
27k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
A better future with KSS
kneath
240
18k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
650
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
400
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
560
Ethics towards AI in product and experience design
skipperchong
2
370
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
970
A Tale of Four Properties
chriscoyier
163
24k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
560
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
490
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
490
Transcript
同じってなんだ?
Hello! I am Hirofumi Horiuchi. Corp: Job: IoT Engineer Hobby:
Camp, Watting Football @h_reader 2
“ プログラミングの世界で 同じかどうかを比較するには 主に == を使います。
“ a == 2 とか
“ Javascriptでは == と === があり これは違う比較です
“ Javascriptでいう 同じとは何なのでしょうか?
== と === の違い == とは 等値演算子 (ざっくり等しい) === とは同値演算子
(きっちり等しい)
“ 10 と 10 は等しい?
“ 10 == 10 -> true 10 === 10 ->
true
“ 10 と “10“ は等しい?
“ 10 == “10” -> true 10 === “10” ->
false
“ 16 と “0x10” は等しい?
“ 16 == “0x10” -> true 16 === “0x10” ->
false
“ 1 と true は等しい?
“ 1 == true -> true 1 === true ->
false
“ 1 と “true” は等しい?
“ 1 == ‘true’ -> false 1 === ‘true’ ->
false
“ “str”と new String(‘str’)は等しい?
“ “str” == new String(“str”) -> true “str” === new
String(“str”) -> false
“ null と undifined は等しい?
“ null == undefined -> true null === undefined ->
false
“ null と “” は等しい?
“ null == “” -> false null === “” ->
false
== と === の違いまとめ 条件式 == === 10 == 10
true true 10 == “10” true false 16 == “0x10” true false 1 == true true false 1 == ‘true’ false false “str” == new String(“str”) true false null == undefined true false “” == null false false
結局どう使えばいいの? ・値を比較したい場合、 === を使った方が安全 (10 と “10” は別だから) ・Nullチェックは、 ==
を使うのが楽 (null も undefined も、両方チェックしたいから) ただし、空文字は引っかからないので注意 ・Switch文は === の比較になる ・やはりエディタはVSCode
26 Thanks! Any questions? You can find me at ▪
@h_reader