<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kikiki-kiki</author_name>
  <author_url>https://blog.hatena.ne.jp/kikiki-kiki/</author_url>
  <blog_title>かもメモ</blog_title>
  <blog_url>https://chaika.hatenablog.com/</blog_url>
  <categories>
    <anon>JavaScript</anon>
  </categories>
  <description>例えば入力された数字をそのまま比較するなどすると、数字が文字列になっていると予期せぬ挙動をする事があります。 // 引数を比較して大きい方を返す関数 var f = function(a, b) { if(a == b) { return &quot;eq&quot; } else { return (a &gt; b)? a : b; } } // 数字を比較 f(5, 55); // 55 f(6, 55); // 55 // 文字列の数字を比較 f(&quot;5&quot;, &quot;55&quot;); // &quot;55&quot; f(&quot;6&quot;, &quot;55&quot;); // &quot;6&quot; ヾ(ヽ*ω*) ヌ!? f(&quot;50&quot;, &quot;55&quot;); // &quot;55&quot; f(&quot;56&quot;,…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchaika.hatenablog.com%2Fentry%2F2016%2F02%2F01%2F153218&quot; title=&quot;javascript 文字列のまま数字を比較すると危険が危ない。 - かもメモ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>http://ecx.images-amazon.com/images/I/51l0nocFbqL.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-02-01 15:32:18</published>
  <title>javascript 文字列のまま数字を比較すると危険が危ない。</title>
  <type>rich</type>
  <url>https://chaika.hatenablog.com/entry/2016/02/01/153218</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
