Upgrade to Pro — share decks privately, control downloads, hide ads and more …

==と===を調べてみた

 ==と===を調べてみた

We Are JavaScripters! @6th の登壇資料です。

C9a975aa71aa1b91ca45c7eccffab4db?s=128

igayamaguchi

April 27, 2017
Tweet

More Decks by igayamaguchi

Other Decks in Technology

Transcript

  1. ͱ !*HBOJO5FB

  2. ͭͷ౳஋ԋࢉࢠ ᐆດͳൺֱ ݫີͳൺֱ // ᐆດͳൺֱͰ͸ܕΛൺֱ͠ͳ͍ > 1 == '1' true

    // ݫີͳൺֱͰ͸ܕ΋ൺֱ͢Δ > 1 === '1' false
  3. ࣗݾ঺հ w ࢁޱকر w ޚ஡ϊਫͷ8&#αΠτडୗ w ࠷ۙ͸$ "41/&5.7$ ɺ 1)1

    w 7VFKTνϣοτ w झຯͰ-BSBWFM w 5XJUUFS*%!*HBOJO5FB
  4. &$."4DSJQU

  5. ͷॲཧͷྲྀΕ ܕͷൺֱ ஋ͷൺֱ

  6. ͷॲཧͷྲྀΕ ಉ͡ܕͰ͋Ε͹஋ͷൺֱ ஋ͷᐆດͳൺֱ

  7. ϓϦϛςΟϒܕͷᐆດͳൺֱ ยํͷ஋͕OVMMͰ΋͏ยํͷ஋͕ VOEFpOFEͷ৔߹ɺUSVF ยํͷ஋͕਺஋Ͱ΋͏ยํ͕จࣈྻͷ৔ ߹ɺจࣈྻΛ਺஋ʹม׵͔ͯ͠Β࠶౓ ஋͕ਅِ஋ͷ৔߹ɺ਺஋ʹม׵͔ͯ͠Β 

  8. ࢀরܕͷᐆດͳൺֱ WBMVF0Gϝιου ϓϦϛςΟϒܕ͕ฦΔ৔߹ɺͦͷ஋Λ࢖ ༻ͯ͠࠶౓ > [1, 2, 3].valueOf() [ 1,

    2, 3 ] > {a: 1, b: 2, c: 3}.valueOf() { a: 1, b: 2, c: 3 }
  9. ࢀরܕͷᐆດͳൺֱ UP4USJOHϝιου ϓϦϛςΟϒܕ͕ฦΔ৔߹ɺͦͷ஋Λ࢖ ༻ͯ͠࠶౓ > [1, 2, 3].toString() '1,2,3' >

    ({a: 1, b: 2, c: 3}.toString()) '[object Object]'
  10. ֘౰͢Δ΋ͷ͕ ແ͚Ε͹GBMTF

  11. ͸΍ΊΑ͏