{"id":858,"date":"2025-08-05T16:44:10","date_gmt":"2025-08-05T07:44:10","guid":{"rendered":"https:\/\/nexive.tech\/?p=858"},"modified":"2025-08-05T16:44:10","modified_gmt":"2025-08-05T07:44:10","slug":"%e3%80%90%e3%82%b5%e3%82%af%e3%83%83%e3%81%a8%e8%a7%a3%e8%aa%ac%e3%80%91javascript%e3%81%ae%e6%bc%94%e7%ae%97%e5%ad%90%e3%82%92%e6%95%b4%e7%90%86","status":"publish","type":"post","link":"https:\/\/nexive.tech\/?p=858","title":{"rendered":"\u3010\u30b5\u30af\u30c3\u3068\u89e3\u8aac\u3011JavaScript\u306e\u6f14\u7b97\u5b50\u3092\u6574\u7406"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>JavaScript\u306b\u304a\u3051\u308b\u57fa\u672c\u7684\u306a\u6f14\u7b97\u5b50\uff08+ &#8211; * \/ %\uff09\u306e\u52d5\u4f5c\u3092\u6574\u7406<\/li>\n\n\n\n<li>\u6bd4\u8f03\u6f14\u7b97\u5b50\uff08== \u3068 ===\uff09\u306e\u9055\u3044\u3068\u8a2d\u8a08\u610f\u56f3\u3092\u89e3\u8aac<\/li>\n\n\n\n<li>\u578b\u5909\u63db\u3092\u4f34\u3046\u6697\u9ed9\u7684\u306a\u6319\u52d5\u306e\u6ce8\u610f\u70b9\u3082\u88dc\u8db3<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">2. JavaScript\u306e\u6f14\u7b97\u5b50\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>JavaScript\u306b\u306f\u3001\u6570\u5024\u306e\u8a08\u7b97\u3084\u5024\u306e\u6bd4\u8f03\u306b\u4f7f\u7528\u3055\u308c\u308b\u6f14\u7b97\u5b50\u304c\u591a\u6570\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br>\u4ee3\u8868\u7684\u306a\u7b97\u8853\u6f14\u7b97\u5b50\u306b\u306f <code>+<\/code>, <code>-<\/code>, <code>*<\/code>, <code>\/<\/code>, <code>%<\/code> \u304c\u3042\u308a\u3001\u6bd4\u8f03\u6f14\u7b97\u5b50\u306b\u306f <code>==<\/code> \u3068 <code>===<\/code> \u304c\u542b\u307e\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7279\u306b <code>==<\/code>\uff08\u62bd\u8c61\u7684\u7b49\u4fa1\uff09\u3068 <code>===<\/code>\uff08\u53b3\u5bc6\u306a\u7b49\u4fa1\uff09\u306f\u6df7\u540c\u3055\u308c\u3084\u3059\u304f\u3001\u6697\u9ed9\u306e\u578b\u5909\u63db\u306e\u6709\u7121\u304c\u6319\u52d5\u306b\u5927\u304d\u304f\u5f71\u97ff\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u6f14\u7b97\u5b50\u306f\u65e5\u5e38\u7684\u306a\u696d\u52d9\u30b3\u30fc\u30c9\u306b\u983b\u51fa\u3059\u308b\u305f\u3081\u3001\u52d5\u4f5c\u4ed5\u69d8\u3092\u6b63\u78ba\u306b\u7406\u89e3\u3057\u3066\u304a\u304f\u3053\u3068\u306f\u5b9f\u88c5\u306e\u4fe1\u983c\u6027\u5411\u4e0a\u306b\u76f4\u7d50\u3057\u307e\u3059\u3002<br>\u307e\u305f\u3001\u578b\u5909\u63db\u3084\u6d6e\u52d5\u5c0f\u6570\u70b9\u306e\u4ed5\u69d8\u3082\u7d61\u3080\u305f\u3081\u3001\u6ce8\u610f\u6df1\u3044\u8a2d\u8a08\u5224\u65ad\u304c\u6c42\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. \u8a73\u7d30\u89e3\u8aac<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u6570\u5024\u6f14\u7b97\u5b50\uff08+\u3001-\u3001*\u3001\/\u3001%\uff09<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u57fa\u672c\u7684\u306a\u6570\u5024\u6f14\u7b97\u5b50\u306e\u4f7f\u7528\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">JavaScript<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>const a = 10;\nconst b = 3;\n\nconsole.log(a + b);  \/\/ 13\nconsole.log(a - b);  \/\/ 7\nconsole.log(a * b);  \/\/ 30\nconsole.log(a \/ b);  \/\/ 3.333...\nconsole.log(a % b);  \/\/ 1\uff08\u5270\u4f59\uff09\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4FC1FF\">a<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #B5CEA8\">10<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4FC1FF\">b<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #B5CEA8\">3<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">a<\/span><span style=\"color: #D4D4D4\"> + <\/span><span style=\"color: #9CDCFE\">b<\/span><span style=\"color: #D4D4D4\">);  <\/span><span style=\"color: #6A9955\">\/\/ 13<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">a<\/span><span style=\"color: #D4D4D4\"> - <\/span><span style=\"color: #9CDCFE\">b<\/span><span style=\"color: #D4D4D4\">);  <\/span><span style=\"color: #6A9955\">\/\/ 7<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">a<\/span><span style=\"color: #D4D4D4\"> * <\/span><span style=\"color: #9CDCFE\">b<\/span><span style=\"color: #D4D4D4\">);  <\/span><span style=\"color: #6A9955\">\/\/ 30<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">a<\/span><span style=\"color: #D4D4D4\"> \/ <\/span><span style=\"color: #9CDCFE\">b<\/span><span style=\"color: #D4D4D4\">);  <\/span><span style=\"color: #6A9955\">\/\/ 3.333...<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">a<\/span><span style=\"color: #D4D4D4\"> % <\/span><span style=\"color: #9CDCFE\">b<\/span><span style=\"color: #D4D4D4\">);  <\/span><span style=\"color: #6A9955\">\/\/ 1\uff08\u5270\u4f59\uff09<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u6f14\u7b97\u5b50\u306f\u3059\u3079\u3066\u5de6\u304b\u3089\u53f3\u3078\u306e\u9806\u3067\u8a55\u4fa1\u3055\u308c\u3001\u6f14\u7b97\u5bfe\u8c61\u306f\u4e21\u8fba\u304c\u6570\u5024\u3067\u3042\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">+ \u6f14\u7b97\u5b50\u3068\u6587\u5b57\u5217\u9023\u7d50\u306e\u6ce8\u610f\u70b9<\/h3>\n\n\n\n<p><code>+<\/code> \u306f\u6570\u5024\u6f14\u7b97\u3060\u3051\u3067\u306a\u304f\u3001\u6587\u5b57\u5217\u9023\u7d50\u306b\u3082\u4f7f\u308f\u308c\u307e\u3059\u3002\u578b\u306b\u3088\u3063\u3066\u6319\u52d5\u304c\u5909\u308f\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">JavaScript<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>console.log(1 + 2);         \/\/ 3\uff08\u6570\u5024\uff09\nconsole.log('1' + 2);       \/\/ \"12\"\uff08\u6587\u5b57\u5217\uff09\nconsole.log(1 + '2');       \/\/ \"12\"\uff08\u6587\u5b57\u5217\uff09\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\"> + <\/span><span style=\"color: #B5CEA8\">2<\/span><span style=\"color: #D4D4D4\">);         <\/span><span style=\"color: #6A9955\">\/\/ 3\uff08\u6570\u5024\uff09<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&#39;1&#39;<\/span><span style=\"color: #D4D4D4\"> + <\/span><span style=\"color: #B5CEA8\">2<\/span><span style=\"color: #D4D4D4\">);       <\/span><span style=\"color: #6A9955\">\/\/ &quot;12&quot;\uff08\u6587\u5b57\u5217\uff09<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\"> + <\/span><span style=\"color: #CE9178\">&#39;2&#39;<\/span><span style=\"color: #D4D4D4\">);       <\/span><span style=\"color: #6A9955\">\/\/ &quot;12&quot;\uff08\u6587\u5b57\u5217\uff09<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u7247\u65b9\u304c\u6587\u5b57\u5217\u306e\u5834\u5408\u3001JavaScript\u306f\u6697\u9ed9\u7684\u306b\u3082\u3046\u4e00\u65b9\u3092\u6587\u5b57\u5217\u5316\u3057\u3066\u9023\u7d50\u3057\u307e\u3059\u3002<br>\u610f\u56f3\u3057\u306a\u3044\u7d50\u679c\u3092\u9632\u3050\u306b\u306f\u3001\u660e\u793a\u7684\u306a\u578b\u5909\u63db\u3092\u884c\u3046\u306e\u304c\u5b89\u5168\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6bd4\u8f03\u6f14\u7b97\u5b50\uff08== \u3068 === \u306e\u9055\u3044\uff09<\/h3>\n\n\n\n<p><code>==<\/code> \u306f\u6697\u9ed9\u306e\u578b\u5909\u63db\u3092\u884c\u3044\u3001<code>===<\/code> \u306f\u578b\u3068\u5024\u306e\u4e21\u65b9\u3092\u6bd4\u8f03\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">JavaScript<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>console.log(1 == '1');   \/\/ true\uff08\u578b\u5909\u63db\u304c\u884c\u308f\u308c\u308b\uff09\nconsole.log(1 === '1');  \/\/ false\uff08\u578b\u304c\u7570\u306a\u308b\u305f\u3081\uff09\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\"> == <\/span><span style=\"color: #CE9178\">&#39;1&#39;<\/span><span style=\"color: #D4D4D4\">);   <\/span><span style=\"color: #6A9955\">\/\/ true\uff08\u578b\u5909\u63db\u304c\u884c\u308f\u308c\u308b\uff09<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\"> === <\/span><span style=\"color: #CE9178\">&#39;1&#39;<\/span><span style=\"color: #D4D4D4\">);  <\/span><span style=\"color: #6A9955\">\/\/ false\uff08\u578b\u304c\u7570\u306a\u308b\u305f\u3081\uff09<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u5b9f\u52d9\u3067\u306f\u539f\u5247\u3068\u3057\u3066 <code>===<\/code> \u3092\u4f7f\u7528\u3059\u308b\u306e\u304c\u5b89\u5168\u3067\u3059\u3002<br>\u3053\u308c\u306f\u610f\u56f3\u3057\u306a\u3044\u578b\u5909\u63db\u306b\u3088\u308b\u30d0\u30b0\u3092\u9632\u3050\u305f\u3081\u3067\u3001ESLint\u306a\u3069\u306e\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3067\u3082 <code>==<\/code> \u306f\u8b66\u544a\u5bfe\u8c61\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">NaN \u3084 null\/undefined \u3068\u306e\u6bd4\u8f03<\/h3>\n\n\n\n<p>\u7279\u6b8a\u306a\u6bd4\u8f03\u7d50\u679c\u3092\u8fd4\u3059\u30b1\u30fc\u30b9\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:16px 0 0 16px;width:100%;text-align:left;background-color:#1e1e1e\"><span style=\"background:#c7c7c7;padding:0.3rem 0.5rem 0.2rem;border-radius:1rem;font-size:0.8em;line-height:1;height:1.25rem;text-align:center;display:inline-flex;align-items:center;justify-content:center;color:#1e1e1e\">JavaScript<\/span><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>console.log(NaN === NaN);       \/\/ false\uff08NaN\u306f\u5e38\u306b\u81ea\u8eab\u3068\u7b49\u3057\u304f\u306a\u3044\uff09\nconsole.log(null == undefined); \/\/ true\uff08==\u3067\u306f\u7b49\u3057\u3044\uff09\nconsole.log(null === undefined);\/\/ false\uff08\u578b\u304c\u7570\u306a\u308b\uff09\n<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #569CD6\">NaN<\/span><span style=\"color: #D4D4D4\"> === <\/span><span style=\"color: #569CD6\">NaN<\/span><span style=\"color: #D4D4D4\">);       <\/span><span style=\"color: #6A9955\">\/\/ false\uff08NaN\u306f\u5e38\u306b\u81ea\u8eab\u3068\u7b49\u3057\u304f\u306a\u3044\uff09<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #569CD6\">null<\/span><span style=\"color: #D4D4D4\"> == <\/span><span style=\"color: #569CD6\">undefined<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ true\uff08==\u3067\u306f\u7b49\u3057\u3044\uff09<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">console<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">log<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #569CD6\">null<\/span><span style=\"color: #D4D4D4\"> === <\/span><span style=\"color: #569CD6\">undefined<\/span><span style=\"color: #D4D4D4\">);<\/span><span style=\"color: #6A9955\">\/\/ false\uff08\u578b\u304c\u7570\u306a\u308b\uff09<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306a\u4f8b\u5916\u7684\u6319\u52d5\u3092\u77e5\u3063\u3066\u304a\u304f\u3053\u3068\u304c\u3001\u5805\u7262\u306a\u6bd4\u8f03\u30ed\u30b8\u30c3\u30af\u306e\u5b9f\u88c5\u306b\u7e4b\u304c\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. \u3088\u304f\u3042\u308b\u30df\u30b9\u30fb\u8aa4\u89e3\u30fb\u843d\u3068\u3057\u7a74<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>+<\/code>\u6f14\u7b97\u5b50\u306e\u6587\u5b57\u5217\u9023\u7d50\u3068\u6570\u5024\u52a0\u7b97\u306e\u6df7\u540c\u304c\u5178\u578b\u4f8b\u3067\u3059\u3002\u7279\u306b\u30d5\u30a9\u30fc\u30e0\u5165\u529b\u5024\uff08\u3059\u3079\u3066\u6587\u5b57\u5217\uff09\u306e\u52a0\u7b97\u3067\u8aa4\u52d5\u4f5c\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>==<\/code> \u3092\u4f7f\u3063\u305f\u66d6\u6627\u306a\u6bd4\u8f03\u306b\u3088\u3063\u3066\u3001<code>false == 0<\/code> \u3084 <code>'' == 0<\/code> \u306e\u3088\u3046\u306a\u76f4\u611f\u306b\u53cd\u3059\u308b\u7d50\u679c\u304c\u767a\u751f\u3059\u308b\u305f\u3081\u3001\u907f\u3051\u308b\u3079\u304d\u3067\u3059\u3002<\/li>\n\n\n\n<li>NaN\u306e\u6bd4\u8f03\u306f\u5e38\u306b <code>false<\/code> \u3092\u8fd4\u3059\u305f\u3081\u3001\u7b49\u4fa1\u5224\u5b9a\u306b\u306f <code>isNaN()<\/code> \u3084 <code>Number.isNaN()<\/code> \u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>\/<\/code>\u6f14\u7b97\u5b50\u306f\u6574\u6570\u540c\u58eb\u3067\u3082\u7d50\u679c\u304c\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u306b\u306a\u308b\u305f\u3081\u3001\u4e38\u3081\u304c\u5fc5\u8981\u306a\u5834\u5408\u306f <code>Math.floor()<\/code> \u306a\u3069\u306e\u4f75\u7528\u304c\u5fc5\u8981\u3067\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u307e\u3068\u3081<\/h2>\n\n\n\n<p>JavaScript\u306e\u57fa\u672c\u6f14\u7b97\u5b50\u306f\u30b7\u30f3\u30d7\u30eb\u306b\u898b\u3048\u307e\u3059\u304c\u3001\u578b\u306e\u6271\u3044\u3084\u6697\u9ed9\u7684\u306a\u5909\u63db\u3001\u7279\u6b8a\u306a\u6319\u52d5\u306b\u3088\u308a\u30df\u30b9\u304c\u751f\u307e\u308c\u3084\u3059\u3044\u5074\u9762\u3082\u3042\u308a\u307e\u3059\u3002<br>\u6bd4\u8f03\u306b\u306f <code>===<\/code> \u3092\u4f7f\u3046\u3001\u6587\u5b57\u5217\u3068\u6570\u5024\u306e\u6df7\u5728\u306b\u6ce8\u610f\u3059\u308b\u306a\u3069\u3001\u57fa\u672c\u4ed5\u69d8\u3092\u6b63\u3057\u304f\u7406\u89e3\u3057\u305f\u3046\u3048\u3067\u8a2d\u8a08\u30fb\u5b9f\u88c5\u3092\u884c\u3046\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8 2. JavaScript\u306e\u6f14\u7b97\u5b50\u3068\u306f\uff1f JavaScript\u306b\u306f\u3001\u6570\u5024\u306e\u8a08\u7b97\u3084\u5024\u306e\u6bd4\u8f03\u306b\u4f7f\u7528\u3055\u308c\u308b\u6f14\u7b97\u5b50\u304c\u591a\u6570\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u4ee3\u8868\u7684\u306a\u7b97\u8853\u6f14\u7b97\u5b50\u306b\u306f +, -, *, \/, % \u304c\u3042\u308a\u3001\u6bd4\u8f03\u6f14 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":936,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[86],"tags":[],"class_list":["post-858","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=858"}],"version-history":[{"count":2,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/858\/revisions"}],"predecessor-version":[{"id":937,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/858\/revisions\/937"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/media\/936"}],"wp:attachment":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}