{"id":1934,"date":"2025-12-11T12:13:03","date_gmt":"2025-12-11T03:13:03","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/?post_type=route&#038;p=1934"},"modified":"2026-03-11T12:13:12","modified_gmt":"2026-03-11T03:13:12","slug":"javascript%e6%96%87%e5%ad%97%e5%88%97%e6%af%94%e8%bc%83%e3%83%bb%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%82%bd%e3%83%bc%e3%83%88%e5%ae%8c%e5%85%a8%e3%82%ac%e3%82%a4%e3%83%89%ef%bd%9c%e5%ae%9f%e5%8b%99%e3%81%a7","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/1934\/","title":{"rendered":"JavaScript\u6587\u5b57\u5217\u6bd4\u8f03\u30fb\u65e5\u672c\u8a9e\u30bd\u30fc\u30c8\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u5b9f\u52d9\u3067\u4f7f\u3048\u308b5\u3064\u306e\u65b9\u6cd5"},"content":{"rendered":"<div>\n<h2>\u306f\u3058\u3081\u306b\uff5c\u3053\u306e\u8a18\u4e8b\u3067\u5f97\u3089\u308c\u308b\u4fa1\u5024<\/h2>\n<p>\n    \u300cJavaScript\u3067\u4e94\u5341\u97f3\u9806\u306b\u4e26\u3079\u305f\u306f\u305a\u306a\u306e\u306b\u3001\u9806\u756a\u304c\u30d0\u30e9\u30d0\u30e9\u2026\u2026\u300d<br \/>\n    \u305d\u3093\u306a\u5834\u9762\u3067\u7126\u3063\u305f\u7d4c\u9a13\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<\/p>\n<p>    \u79c1\u305f\u3061\u3082\u3001\u4e00\u89a7\u753b\u9762\u306e\u30bd\u30fc\u30c8\u5b9f\u88c5\u3067<br \/>\n    \u540c\u3058\u58c1\u306b\u3076\u3064\u304b\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>    \u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u65e5\u672c\u8a9e\u7279\u6709\u306e\u4e26\u3073\u9806\u306e\u96e3\u3057\u3055\u3092\u6574\u7406\u3057\u306a\u304c\u3089\u3001<br \/>\n    \u5b9f\u52d9\u3067\u305d\u306e\u307e\u307e\u4f7f\u3044\u3084\u3059\u3044\u6bd4\u8f03\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>    \u7279\u306b\u62bc\u3055\u3048\u305f\u3044\u306e\u306f\u3001\u6b21\u306e3\u70b9\u3067\u3059\u3002<br \/>\n    \u30fb<strong>===<\/strong> \u3068 <strong>==<\/strong> \u306e\u9055\u3044<br \/>\n    \u30fb<strong>localeCompare()<\/strong> \u3068 <strong>Intl.Collator<\/strong> \u306e\u4f7f\u3044\u5206\u3051<br \/>\n    \u30fb<strong>normalize(&#8220;NFC&#8221;)<\/strong> \u306b\u3088\u308b\u8868\u8a18\u63fa\u308c\u5bfe\u7b56<\/p>\n<p>    \u300c\u7406\u5c48\u306f\u3042\u3068\u3067\u3044\u3044\u304b\u3089\u3001\u307e\u305a\u6b63\u3057\u304f\u52d5\u304f\u5f62\u3092\u77e5\u308a\u305f\u3044\u300d<br \/>\n    \u305d\u3093\u306a\u3068\u304d\u306e\u5165\u53e3\u3068\u3057\u3066\u8aad\u3081\u308b\u69cb\u6210\u306b\u3057\u3066\u3044\u307e\u3059\u3002\n  <\/p>\n<hr \/>\n<h2>1. \u306a\u305c <strong>===<\/strong> \u3092\u57fa\u672c\u306b\u3059\u308b\u306e\u304b<\/h2>\n<p>\n    \u6587\u5b57\u5217\u306e\u4e00\u81f4\u5224\u5b9a\u3067\u306f\u3001\u307e\u305a <strong>===<\/strong> \u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<br \/>\n    \u7406\u7531\u306f\u3068\u3066\u3082\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<p>    <strong>==<\/strong> \u306f\u6bd4\u8f03\u6642\u306b\u3001\u81ea\u52d5\u3067\u578b\u5909\u63db\u3092\u884c\u3046\u304b\u3089\u3067\u3059\u3002<br \/>\n    \u3053\u306e\u6319\u52d5\u304c\u3001\u601d\u308f\u306c\u4e0d\u5177\u5408\u306e\u5165\u53e3\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>    \u305f\u3068\u3048\u3070\u3001\u6587\u5b57\u5217\u306e <strong>&#8220;1&#8221;<\/strong> \u3068\u6570\u5024\u306e <strong>1<\/strong> \u306f\u3001<br \/>\n    <strong>==<\/strong> \u3060\u3068 <strong>true<\/strong> \u306b\u306a\u308a\u307e\u3059\u3002\n  <\/p>\n<pre><code>console.log(\"1\" == 1);  \/\/ true\r\nconsole.log(\"1\" === 1); \/\/ false<\/code><\/pre>\n<p>\n    \u5b9f\u52d9\u3067\u306f\u300c\u898b\u305f\u76ee\u304c\u540c\u3058\u300d\u3088\u308a\u3082\u3001<br \/>\n    \u300c\u578b\u307e\u3067\u4e00\u81f4\u3057\u3066\u3044\u308b\u300d\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n<p>    \u4e00\u89a7\u753b\u9762\u3084\u691c\u7d22\u6761\u4ef6\u306e\u6bd4\u8f03\u3067\u3082\u3001<br \/>\n    \u66d6\u6627\u3055\u3092\u6b8b\u3055\u306a\u3044\u307b\u3046\u304c\u5b89\u5168\u3067\u3059\u3002\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u53b3\u5bc6\u7b49\u4fa1\u6f14\u7b97\u5b50<\/strong><br \/>\n      \u5024\u3060\u3051\u3067\u306a\u304f\u3001\u578b\u307e\u3067\u542b\u3081\u3066\u4e00\u81f4\u3057\u3066\u3044\u308b\u304b\u3092\u5224\u5b9a\u3059\u308b\u6f14\u7b97\u5b50\u3067\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u7b49\u4fa1\u6f14\u7b97\u5b50<\/strong><br \/>\n      \u578b\u304c\u9055\u3063\u3066\u3044\u3066\u3082\u3001\u81ea\u52d5\u5909\u63db\u3057\u305f\u3046\u3048\u3067\u6bd4\u8f03\u3059\u308b\u6f14\u7b97\u5b50\u3067\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u6697\u9ed9\u306e\u578b\u5909\u63db<\/strong><br \/>\n      \u5b9f\u884c\u6642\u306b\u30c7\u30fc\u30bf\u578b\u304c\u81ea\u52d5\u3067\u5909\u308f\u308b\u3053\u3068\u3067\u3059\u3002\u610f\u56f3\u3057\u306a\u3044\u4e00\u81f4\u306e\u539f\u56e0\u306b\u306a\u308a\u307e\u3059\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>2. \u306a\u305c <strong>&gt;<\/strong> \u3084 <strong>&lt;<\/strong> \u3067\u306f\u65e5\u672c\u8a9e\u30bd\u30fc\u30c8\u304c\u5d29\u308c\u308b\u306e\u304b<\/h2>\n<p>\n    \u300c\u6587\u5b57\u5217\u306a\u3089 <strong>a &gt; b<\/strong> \u3067\u6bd4\u8f03\u3067\u304d\u308b\u306e\u3067\u306f\uff1f\u300d<br \/>\n    \u305d\u3046\u8003\u3048\u305f\u304f\u306a\u308a\u307e\u3059\u304c\u3001\u65e5\u672c\u8a9e\u3067\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>    \u6bd4\u8f03\u6f14\u7b97\u5b50\u306f\u3001\u57fa\u672c\u7684\u306b<br \/>\n    \u6587\u5b57\u306e\u4e26\u3073\u3092\u30b3\u30fc\u30c9\u9806\u3067\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>    \u3053\u306e\u9806\u756a\u306f\u3001\u79c1\u305f\u3061\u304c\u671f\u5f85\u3059\u308b<br \/>\n    \u4e94\u5341\u97f3\u9806\u3084\u8f9e\u66f8\u9806\u3068\u306f\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>    \u305d\u306e\u305f\u3081\u3001\u6b21\u306e\u3088\u3046\u306a\u30ba\u30ec\u304c\u8d77\u3053\u308a\u307e\u3059\u3002\n  <\/p>\n<ul>\n<li>\u3072\u3089\u304c\u306a\u3068\u30ab\u30bf\u30ab\u30ca\u304c\u76f4\u611f\u3069\u304a\u308a\u306b\u4e26\u3070\u306a\u3044<\/li>\n<li>\u534a\u89d2\u30ab\u30bf\u30ab\u30ca\u3068\u5168\u89d2\u30ab\u30bf\u30ab\u30ca\u304c\u6df7\u5728\u3059\u308b\u3068\u5d29\u308c\u308b<\/li>\n<li>\u6570\u5b57\u3092\u542b\u3080\u6587\u5b57\u5217\u304c\u81ea\u7136\u306a\u9806\u756a\u306b\u306a\u3089\u306a\u3044<\/li>\n<\/ul>\n<p>\n    \u305f\u3068\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u6c42\u3081\u3066\u3044\u308b\u306e\u306f<br \/>\n    \u300c\u8f9e\u66f8\u3067\u898b\u308b\u4e26\u3073\u300d\u306b\u8fd1\u3044\u9806\u5e8f\u3067\u3059\u3002<\/p>\n<p>    \u4e00\u65b9\u3067\u3001\u5358\u7d14\u6bd4\u8f03\u306f<br \/>\n    \u300c\u5185\u90e8\u7684\u306a\u6587\u5b57\u30b3\u30fc\u30c9\u306e\u9806\u5e8f\u300d\u3067\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>    \u3053\u306e\u5dee\u3092\u7406\u89e3\u3057\u3066\u304a\u304f\u3068\u3001<br \/>\n    \u30ec\u30d3\u30e5\u30fc\u3067\u3082\u8aac\u660e\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002\n  <\/p>\n<blockquote>\n<p>\n      <strong>Unicode\u30b3\u30fc\u30c9\u30dd\u30a4\u30f3\u30c8<\/strong><br \/>\n      \u6587\u5b57\u3054\u3068\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u756a\u53f7\u3067\u3059\u3002\u756a\u53f7\u9806\u306f\u3001\u5fc5\u305a\u3057\u3082\u65e5\u672c\u8a9e\u306e\u8f9e\u66f8\u9806\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>3. \u65e5\u672c\u8a9e\u6bd4\u8f03\u306e\u57fa\u672c\u306f <strong>localeCompare()<\/strong> \u3068 <strong>Intl.Collator<\/strong><\/h2>\n<p>\n    \u3067\u306f\u3001\u3069\u3046\u3084\u3063\u3066\u65e5\u672c\u8a9e\u3092\u81ea\u7136\u306b\u6bd4\u8f03\u3059\u308c\u3070\u3088\u3044\u306e\u3067\u3057\u3087\u3046\u304b\uff1f<br \/>\n    \u3053\u3053\u3067\u4f7f\u3046\u306e\u304c\u3001\u8a00\u8a9e\u30eb\u30fc\u30eb\u3092\u8003\u616e\u3067\u304d\u308b\u6bd4\u8f03\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p>    \u4ee3\u8868\u7684\u306a\u306e\u306f <strong>localeCompare()<\/strong> \u3068 <strong>Intl.Collator<\/strong> \u3067\u3059\u3002\n  <\/p>\n<h3>\u25a0 \u624b\u8efd\u306b\u8a66\u305b\u308b <strong>localeCompare()<\/strong><\/h3>\n<p>\n    \u307e\u305a\u8a66\u3057\u3084\u3059\u3044\u306e\u304c <strong>localeCompare()<\/strong> \u3067\u3059\u3002<br \/>\n    \u6587\u5b57\u5217\u540c\u58eb\u3092\u3001\u6307\u5b9a\u3057\u305f\u30ed\u30b1\u30fc\u30eb\u3067\u6bd4\u8f03\u3067\u304d\u307e\u3059\u3002\n  <\/p>\n<pre><code>const list = [\"\u3044\", \"\u3042\", \"\u3046\"];\r\nlist.sort((a, b) =&gt; a.localeCompare(b, \"ja\"));\r\n\r\n\/\/ [\"\u3042\", \"\u3044\", \"\u3046\"]<\/code><\/pre>\n<p>\n    \u5c0f\u898f\u6a21\u306a\u914d\u5217\u306a\u3089\u3001\u3053\u308c\u3067\u3082\u5341\u5206\u3067\u3059\u3002<br \/>\n    \u300c\u307e\u305a\u6b63\u3057\u304f\u4e26\u3079\u305f\u3044\u300d\u3068\u3044\u3046\u5834\u9762\u3067\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<p>    \u305f\u3060\u3057\u3001\u30bd\u30fc\u30c8\u4ef6\u6570\u304c\u5897\u3048\u308b\u3068<br \/>\n    \u6bd4\u8f03\u56de\u6570\u3082\u4e00\u6c17\u306b\u5897\u3048\u307e\u3059\u3002<\/p>\n<p>    \u305d\u306e\u7d50\u679c\u3001\u6bce\u56de\u306e\u6bd4\u8f03\u30b3\u30b9\u30c8\u304c\u52b9\u3044\u3066\u304d\u3066\u3001<br \/>\n    \u753b\u9762\u306e\u4f53\u611f\u901f\u5ea6\u306b\u5f71\u97ff\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\n  <\/p>\n<h3>\u25a0 \u5b9f\u52d9\u3067\u4f7f\u3044\u3084\u3059\u3044 <strong>Intl.Collator<\/strong><\/h3>\n<p>\n    \u5927\u91cf\u30c7\u30fc\u30bf\u3092\u6271\u3046\u306a\u3089\u3001\u79c1\u305f\u3061\u306f <strong>Intl.Collator<\/strong> \u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002<br \/>\n    \u7406\u7531\u306f\u3001\u4e00\u5ea6\u4f5c\u3063\u305f\u6bd4\u8f03\u8a2d\u5b9a\u3092\u4f7f\u3044\u56de\u305b\u308b\u304b\u3089\u3067\u3059\u3002\n  <\/p>\n<pre><code>const collator = new Intl.Collator(\"ja\");\r\n\r\nconst list = [\"\u3044\", \"\u3042\", \"\u3046\"];\r\nlist.sort(collator.compare);\r\n\r\n\/\/ [\"\u3042\", \"\u3044\", \"\u3046\"]<\/code><\/pre>\n<p>\u5b9f\u52d9\u3067\u4f7f\u3044\u3084\u3059\u3044\u7406\u7531\u306f\u3001\u4e3b\u306b3\u3064\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u6bd4\u8f03\u8a2d\u5b9a\u3092\u518d\u5229\u7528\u3067\u304d\u308b<\/li>\n<li>\u6570\u5024\u6df7\u3058\u308a\u306e\u81ea\u7136\u9806\u30bd\u30fc\u30c8\u306b\u3082\u5bfe\u5fdc\u3067\u304d\u308b<\/li>\n<li>\u4e00\u89a7\u753b\u9762\u306e\u3088\u3046\u306a\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3067\u5b89\u5b9a\u3057\u3084\u3059\u3044<\/li>\n<\/ul>\n<p>\n    \u300c\u6b63\u3057\u3055\u300d\u3068\u300c\u6271\u3044\u3084\u3059\u3055\u300d\u3092\u4e21\u7acb\u3057\u305f\u3044\u3068\u304d\u3001<br \/>\n    \u307e\u305a\u5019\u88dc\u306b\u3057\u305f\u3044\u65b9\u6cd5\u3067\u3059\u3002\n  <\/p>\n<blockquote>\n<p>\n      <strong>String.prototype.localeCompare()<\/strong><br \/>\n      \u6587\u5b57\u5217\u3092\u30ed\u30b1\u30fc\u30eb\u306e\u898f\u5247\u306b\u5f93\u3063\u3066\u6bd4\u8f03\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\n    <\/p>\n<p>\n      <strong>Intl.Collator<\/strong><br \/>\n      \u591a\u8a00\u8a9e\u306e\u6587\u5b57\u5217\u6bd4\u8f03\u3092\u52b9\u7387\u3088\u304f\u884c\u3046\u305f\u3081\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u30e1\u30e2\u30ea\u52b9\u7387<\/strong><br \/>\n      \u540c\u3058\u51e6\u7406\u3092\u7121\u99c4\u306a\u304f\u518d\u5229\u7528\u3057\u3001\u8ca0\u8377\u3092\u6291\u3048\u3084\u3059\u3044\u72b6\u614b\u3092\u6307\u3057\u307e\u3059\u3002\n    <\/p>\n<\/blockquote>\n<p>\n    \u95a2\u9023\u3057\u3066\u3001\u30d6\u30e9\u30a6\u30b6\u8ca0\u8377\u306e\u898b\u65b9\u3092\u6574\u7406\u3057\u305f\u3044\u5834\u5408\u306f\u3001<br \/>\n    \u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1736\/\" target=\"_blank\" rel=\"noopener\">\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30bf\u30d6\u5fb9\u5e95\u89e3\u8aac\uff5cChrome DevTools\u3067Web\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6539\u5584\u306e\u5168\u624b\u9806<\/a>\u300f\u3082\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002\n  <\/p>\n<hr \/>\n<h2>4. <strong>normalize(&#8220;NFC&#8221;)<\/strong> \u304c\u8868\u8a18\u63fa\u308c\u5bfe\u7b56\u3067\u52b9\u304f\u7406\u7531<\/h2>\n<p>\n    \u300c\u898b\u305f\u76ee\u306f\u540c\u3058\u306a\u306e\u306b\u3001\u4e00\u81f4\u3057\u306a\u3044\u2026\u2026\u300d<br \/>\n    \u3053\u306e\u73fe\u8c61\u3082\u3001\u65e5\u672c\u8a9e\u6bd4\u8f03\u3067\u306f\u3088\u304f\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>    \u4ee3\u8868\u4f8b\u304c\u3001\u6fc1\u70b9\u3092\u542b\u3080\u6587\u5b57\u3067\u3059\u3002<br \/>\n    \u305f\u3068\u3048\u3070\u300c\u30ac\u300d\u306f\u3001\u5185\u90e8\u7684\u306b\u306f\u8907\u6570\u306e\u8868\u73fe\u304c\u3042\u308a\u3048\u307e\u3059\u3002\n  <\/p>\n<ul>\n<li>1\u6587\u5b57\u3068\u3057\u3066\u8868\u73fe\u3055\u308c\u305f\u300c\u30ac\u300d<\/li>\n<li>\u300c\u30ab\u300d\u3068\u6fc1\u70b9\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u300c\u30ac\u300d<\/li>\n<\/ul>\n<p>\n    \u898b\u305f\u76ee\u306f\u540c\u3058\u3067\u3082\u3001<br \/>\n    \u305d\u306e\u307e\u307e\u6bd4\u8f03\u3059\u308b\u3068\u4e00\u81f4\u3057\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\n  <\/p>\n<pre><code>const str1 = \"\u30ac\";\r\nconst str2 = \"\u30ab\\u3099\";\r\n\r\nconsole.log(str1 === str2); \/\/ false\r\nconsole.log(str1.normalize(\"NFC\") === str2.normalize(\"NFC\")); \/\/ true<\/code><\/pre>\n<p>\n    \u3053\u3053\u3067\u5f79\u7acb\u3064\u306e\u304c <strong>normalize(&#8220;NFC&#8221;)<\/strong> \u3067\u3059\u3002<br \/>\n    \u6bd4\u8f03\u524d\u306b\u8868\u73fe\u5f62\u5f0f\u3092\u305d\u308d\u3048\u308b\u3053\u3068\u3067\u3001\u8868\u8a18\u63fa\u308c\u3092\u5438\u53ce\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>    \u7279\u306b\u3001\u6b21\u306e\u3088\u3046\u306a\u5165\u529b\u5143\u3067\u306f\u6709\u52b9\u3067\u3059\u3002\n  <\/p>\n<ul>\n<li>\u30e6\u30fc\u30b6\u30fc\u5165\u529b<\/li>\n<li>\u5916\u90e8API\u306e\u30ec\u30b9\u30dd\u30f3\u30b9<\/li>\n<li>CSV\u3084\u30d5\u30a1\u30a4\u30eb\u7d4c\u7531\u306e\u6587\u5b57\u5217<\/li>\n<\/ul>\n<p>\n    \u300c\u8868\u793a\u306f\u540c\u3058\u306a\u306e\u306b\u691c\u7d22\u306b\u30d2\u30c3\u30c8\u3057\u306a\u3044\u300d<br \/>\n    \u305d\u3093\u306a\u4e0d\u5177\u5408\u3092\u6e1b\u3089\u3059\u3046\u3048\u3067\u3001\u3068\u3066\u3082\u5b9f\u7528\u7684\u3067\u3059\u3002\n  <\/p>\n<blockquote>\n<p>\n      <strong>Unicode\u6b63\u898f\u5316\uff08NFC\uff09<\/strong><br \/>\n      \u6587\u5b57\u306e\u5185\u90e8\u8868\u73fe\u3092\u4e00\u5b9a\u306e\u5f62\u5f0f\u306b\u305d\u308d\u3048\u308b\u51e6\u7406\u3067\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u5408\u6210\u6e08\u307f\u6587\u5b57 \/ \u7d50\u5408\u6587\u5b57<\/strong><br \/>\n      1\u6587\u5b57\u3068\u3057\u3066\u6301\u3064\u8868\u73fe\u3068\u3001\u8907\u6570\u6587\u5b57\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u6301\u3064\u8868\u73fe\u306e\u3053\u3068\u3067\u3059\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>5. \u5b9f\u52d9\u3067\u4f7f\u3044\u3084\u3059\u3044\u65e5\u672c\u8a9e\u6bd4\u8f03\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/h2>\n<p>\n    \u3053\u3053\u307e\u3067\u306e\u5185\u5bb9\u3092\u8e0f\u307e\u3048\u3066\u3001<br \/>\n    \u3059\u3050\u4f7f\u3044\u3084\u3059\u3044\u5f62\u30921\u3064\u306b\u307e\u3068\u3081\u307e\u3059\u3002&#x2705;<\/p>\n<p>    \u30dd\u30a4\u30f3\u30c8\u306f\u3001\u6b21\u306e2\u3064\u3067\u3059\u3002\n  <\/p>\n<ul>\n<li><strong>Intl.Collator<\/strong> \u3092\u4f7f\u3044\u56de\u3059<\/li>\n<li>\u6bd4\u8f03\u524d\u306b <strong>normalize(&#8220;NFC&#8221;)<\/strong> \u3067\u305d\u308d\u3048\u308b<\/li>\n<\/ul>\n<pre><code>\/**\r\n * \u65e5\u672c\u8a9e\u306e\u8f9e\u66f8\u9806\u30bd\u30fc\u30c8\u7528\u30b3\u30f3\u30d1\u30ec\u30fc\u30bf\r\n * - Intl.Collator\u3092\u518d\u5229\u7528\u3057\u3066\u9ad8\u901f\u5316\r\n *\/\r\nconst japaneseCollator = new Intl.Collator(\"ja\", {\r\n  numeric: true,\r\n  sensitivity: \"accent\",\r\n});\r\n\r\n\/**\r\n * \u5b89\u5168\u306a\u6587\u5b57\u5217\u6bd4\u8f03\u95a2\u6570\r\n *\/\r\nconst compareJapanese = (a, b) =&gt; {\r\n  const cleanA = (a ?? \"\").normalize(\"NFC\");\r\n  const cleanB = (b ?? \"\").normalize(\"NFC\");\r\n\r\n  return japaneseCollator.compare(cleanA, cleanB);\r\n};\r\n\r\n\/\/ \u4f7f\u7528\u4f8b\r\nconst items = [\"\u7b2c10\u96c6\", \"\u7b2c2\u96c6\", \"\u30ac\u30f3\u30c0\u30e0\", \"\u30ab\u3099\u30f3\u30c0\u30e0\"];\r\nitems.sort(compareJapanese);<\/code><\/pre>\n<p>\n    \u3053\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306a\u3089\u3001<br \/>\n    \u6570\u5024\u6df7\u3058\u308a\u306e\u4e26\u3073\u306b\u3082\u5bfe\u5fdc\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>    \u3055\u3089\u306b\u3001\u6fc1\u70b9\u306e\u8868\u8a18\u5dee\u3082\u5438\u53ce\u3067\u304d\u308b\u305f\u3081\u3001<br \/>\n    \u5b9f\u52d9\u306e\u4e00\u89a7\u30bd\u30fc\u30c8\u3067\u4f7f\u3044\u56de\u3057\u3084\u3059\u3044\u5f62\u3067\u3059\u3002<\/p>\n<p>    <strong>Intl.Collator<\/strong> \u3092\u95a2\u6570\u306e\u5916\u3067\u4f5c\u308b\u306e\u3082\u91cd\u8981\u3067\u3059\u3002<br \/>\n    \u6bce\u56de\u751f\u6210\u3057\u306a\u3044\u3076\u3093\u3001\u7121\u99c4\u306a\u8ca0\u8377\u3092\u6e1b\u3089\u305b\u307e\u3059\u3002\n  <\/p>\n<p>\n    <strong>undefined<\/strong> \u306e\u6df7\u5165\u3067\u56f0\u308b\u5834\u9762\u304c\u591a\u3044\u5834\u5408\u306f\u3001<br \/>\n    \u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1340\/\" target=\"_blank\" rel=\"noopener\">\u306a\u305c\u300cundefined\u300d\u304c\u51fa\u308b\uff1f\u539f\u56e0\u3068\u89e3\u6c7a\u6cd510\u9078\uff5cJavaScript \u306e\u30c7\u30d0\u30c3\u30b0\u306b\u52b9\u304f\u5b9f\u4f8b\u96c6<\/a\n    >\u300f\u3082\u3042\u308f\u305b\u3066\u78ba\u8a8d\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u30b3\u30f3\u30d1\u30ec\u30fc\u30bf<\/strong><br \/>\n      2\u3064\u306e\u5024\u306e\u9806\u5e8f\u3092\u6c7a\u3081\u308b\u305f\u3081\u306e\u6bd4\u8f03\u95a2\u6570\u3067\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u81ea\u7136\u9806\u30bd\u30fc\u30c8<\/strong><br \/>\n      <strong>1, 2, 10<\/strong> \u306e\u3088\u3046\u306b\u3001\u6570\u5b57\u3092\u6570\u5024\u3068\u3057\u3066\u81ea\u7136\u306b\u4e26\u3079\u308b\u65b9\u6cd5\u3067\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9<\/strong><br \/>\n      \u672c\u6765\u306e\u51e6\u7406\u306b\u52a0\u3048\u3066\u767a\u751f\u3059\u308b\u8ffd\u52a0\u30b3\u30b9\u30c8\u306e\u3053\u3068\u3067\u3059\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>6. \u307e\u305a\u62bc\u3055\u3048\u305f\u3044\u5b9f\u52d9\u5224\u65ad\u306e\u307e\u3068\u3081<\/h2>\n<p>\u3053\u3053\u307e\u3067\u3092\u3001\u73fe\u5834\u76ee\u7dda\u3067\u6574\u7406\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u4e00\u81f4\u5224\u5b9a\u306f <strong>===<\/strong> \u3092\u4f7f\u3046<\/li>\n<li>\u65e5\u672c\u8a9e\u30bd\u30fc\u30c8\u306f <strong>Intl.Collator<\/strong> \u3092\u4f7f\u3046<\/li>\n<li>\u6bd4\u8f03\u524d\u306b <strong>normalize(&#8220;NFC&#8221;)<\/strong> \u3092\u901a\u3059<\/li>\n<li>\u6570\u5024\u6df7\u3058\u308a\u306a\u3089 <strong>numeric: true<\/strong> \u3092\u4ed8\u3051\u308b<\/li>\n<\/ul>\n<p>\n    \u300c\u3069\u308c\u3092\u9078\u3079\u3070\u3088\u3044\u304b\u8ff7\u3046\u300d\u3068\u3044\u3046\u72b6\u614b\u306a\u3089\u3001<br \/>\n    \u307e\u305a\u306f\u3053\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u5341\u5206\u6226\u3048\u307e\u3059\u3002<\/p>\n<p>    \u5b9f\u88c5\u306e\u6b63\u3057\u3055\u3060\u3051\u3067\u306a\u304f\u3001<br \/>\n    \u30ec\u30d3\u30e5\u30fc\u3067\u8aac\u660e\u3057\u3084\u3059\u3044\u306e\u3082\u5927\u304d\u306a\u5229\u70b9\u3067\u3059\u3002\n  <\/p>\n<hr \/>\n<h2>FAQ\uff5c\u3088\u304f\u3042\u308b\u7591\u554f<\/h2>\n<h3>\u25a0 <strong>Object.is()<\/strong> \u3092\u4f7f\u3046\u3079\u304d\u5834\u9762\u306f\u3042\u308a\u307e\u3059\u304b\uff1f<\/h3>\n<p>\n    \u901a\u5e38\u306e\u6587\u5b57\u5217\u6bd4\u8f03\u306a\u3089\u3001\u57fa\u672c\u306f <strong>===<\/strong> \u3067\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n    <strong>NaN<\/strong> \u3084 <strong>+0<\/strong> \/ <strong>-0<\/strong> \u306e\u3088\u3046\u306a\u7279\u6b8a\u30b1\u30fc\u30b9\u3092\u53b3\u5bc6\u306b\u6271\u3044\u305f\u3044\u3068\u304d\u306b\u4f7f\u3044\u307e\u3059\u3002\n  <\/p>\n<h3>\u25a0 \u6f22\u5b57\u3082\u4e94\u5341\u97f3\u9806\u306b\u304d\u308c\u3044\u306b\u4e26\u3073\u307e\u3059\u304b\uff1f<\/h3>\n<p>\n    \u6a19\u6e96\u6a5f\u80fd\u3060\u3051\u3067\u306f\u3001\u6f22\u5b57\u306e\u300c\u8aad\u307f\u300d\u307e\u3067\u306f\u5224\u65ad\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n    \u53b3\u5bc6\u306a\u4e94\u5341\u97f3\u9806\u304c\u5fc5\u8981\u306a\u3089\u3001\u30d5\u30ea\u30ac\u30ca\u3084\u8aad\u307f\u4eee\u540d\u30c7\u30fc\u30bf\u3092\u6301\u305f\u305b\u308b\u8a2d\u8a08\u304c\u5fc5\u8981\u3067\u3059\u3002\n  <\/p>\n<h3>\u25a0 \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u91cd\u8996\u306a\u3089\u7d50\u8ad6\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h3>\n<p>\n    \u7d50\u8ad6\u3068\u3057\u3066\u306f\u3001<strong>Intl.Collator<\/strong> \u306e\u518d\u5229\u7528\u304c\u7b2c\u4e00\u5019\u88dc\u3067\u3059\u3002<br \/>\n    React\u306a\u3089 <strong>useMemo<\/strong> \u306a\u3069\u3067\u4fdd\u6301\u3057\u3001\u6bce\u56de\u4f5c\u308a\u76f4\u3055\u306a\u3044\u69cb\u6210\u304c\u6271\u3044\u3084\u3059\u3044\u3067\u3059\u3002\n  <\/p>\n<blockquote>\n<p>\n      <strong>Object.is()<\/strong><br \/>\n      <strong>===<\/strong> \u306b\u8fd1\u3044\u6bd4\u8f03\u3092\u884c\u3044\u306a\u304c\u3089\u3001\u4e00\u90e8\u306e\u7279\u6b8a\u5024\u3092\u3088\u308a\u53b3\u5bc6\u306b\u5224\u5b9a\u3067\u304d\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\n    <\/p>\n<p>\n      <strong>useMemo<\/strong><br \/>\n      \u8a08\u7b97\u7d50\u679c\u3084\u751f\u6210\u3057\u305f\u5024\u3092\u4fdd\u6301\u3057\u3001\u518d\u8a08\u7b97\u3092\u6e1b\u3089\u3059\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3067\u3059\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>7. \u307e\u3068\u3081\uff5c\u8ff7\u3063\u305f\u3089\u3053\u306e\u5f62\u3067\u59cb\u3081\u307e\u3057\u3087\u3046<\/h2>\n<p>\n    JavaScript\u306e\u6587\u5b57\u5217\u6bd4\u8f03\u306f\u3001<br \/>\n    \u4e00\u898b\u30b7\u30f3\u30d7\u30eb\u3067\u3082\u5b9f\u52d9\u3067\u306f\u843d\u3068\u3057\u7a74\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>    \u7279\u306b\u65e5\u672c\u8a9e\u30bd\u30fc\u30c8\u3067\u306f\u3001<br \/>\n    \u5358\u7d14\u6bd4\u8f03\u3060\u3051\u3067\u306f\u671f\u5f85\u3069\u304a\u308a\u306b\u4e26\u3073\u307e\u305b\u3093\u3002<\/p>\n<p>    \u3060\u304b\u3089\u3053\u305d\u3001\u6b21\u306e\u6d41\u308c\u3092\u57fa\u6e96\u306b\u3059\u308b\u3068\u5b89\u5fc3\u3067\u3059\u3002\n  <\/p>\n<ul>\n<li>\u4e00\u81f4\u5224\u5b9a\u306f <strong>===<\/strong><\/li>\n<li>\u4e26\u3073\u66ff\u3048\u306f <strong>Intl.Collator<\/strong><\/li>\n<li>\u8868\u8a18\u63fa\u308c\u5bfe\u7b56\u306f <strong>normalize(&#8220;NFC&#8221;)<\/strong><\/li>\n<\/ul>\n<p>\n    \u307e\u305a\u306f\u624b\u5143\u306e\u4e00\u89a7\u753b\u9762\u3084\u691c\u7d22\u6a5f\u80fd\u3067\u3001<br \/>\n    \u3053\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u305d\u306e\u307e\u307e\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\n  <\/p>\n<p>\n    \u95a2\u9023\u3057\u3066\u3001\u5b9f\u52d9\u3067\u4f7f\u3048\u308bJavaScript\u306e\u8003\u3048\u65b9\u3092\u5e83\u3052\u305f\u3044\u5834\u5408\u306f\u3001<br \/>\n    \u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1136\/\" target=\"_blank\" rel=\"noopener\">JavaScript\u4e2d\u7d1a\u8005\u3078\u306e\u30b9\u30c6\u30c3\u30d7\u30a2\u30c3\u30d7\uff5c\u5b9f\u52d9\u3067\u4f7f\u3048\u308b\u30c6\u30af\u30cb\u30c3\u30af10\u9078<\/a>\u300f\u3082\u53c2\u8003\u306b\u306a\u308a\u307e\u3059\u3002\n  <\/p>\n<p>\u305c\u3072\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30da\u3057\u3066\u3001\u307e\u305a\u306f\u52d5\u304b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n","protected":false},"featured_media":1935,"template":"","_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/1934"}],"collection":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route"}],"about":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/types\/route"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media\/1935"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=1934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}