{"id":852,"date":"2025-08-05T16:38:21","date_gmt":"2025-08-05T07:38:21","guid":{"rendered":"https:\/\/nexive.tech\/?p=852"},"modified":"2025-08-05T16:38:21","modified_gmt":"2025-08-05T07:38:21","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%e3%83%87%e3%83%bc%e3%82%bf%e5%9e%8b%e3%81%a8%e5%9e%8b%e5%a4%89%e6%8f%9b%ef%bc%88number-string-boolean","status":"publish","type":"post","link":"https:\/\/nexive.tech\/?p=852","title":{"rendered":"\u3010\u30b5\u30af\u30c3\u3068\u89e3\u8aac\u3011JavaScript\u306e\u30c7\u30fc\u30bf\u578b\u3068\u578b\u5909\u63db\uff08Number, String, Boolean\uff09"},"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\u30c7\u30fc\u30bf\u578b\uff08\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\uff09\u306e\u7a2e\u985e\u3092\u6574\u7406<\/li>\n\n\n\n<li>\u660e\u793a\u7684\uff0f\u6697\u9ed9\u7684\u306a\u578b\u5909\u63db\u306e\u4ed5\u69d8\u3068\u4ee3\u8868\u7684\u306a\u6319\u52d5\u3092\u5177\u4f53\u4f8b\u4ed8\u304d\u3067\u89e3\u8aac<\/li>\n\n\n\n<li>\u5b9f\u52d9\u3067\u983b\u51fa\u3059\u308b\u578b\u5909\u63db\u306e\u843d\u3068\u3057\u7a74\u3084\u8aa4\u7528\u30d1\u30bf\u30fc\u30f3\u306b\u6ce8\u610f\u559a\u8d77<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">2. JavaScript\u306e\u30c7\u30fc\u30bf\u578b\u3068\u578b\u5909\u63db\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>JavaScript\u306b\u306f\u3001\u5927\u304d\u304f\u5206\u3051\u3066\u300c\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u300d\u3068\u300c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u578b\u300d\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u672c\u8a18\u4e8b\u3067\u306f\u3001\u5b9f\u52d9\u3067\u7279\u306b\u4f7f\u7528\u983b\u5ea6\u304c\u9ad8\u3044\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u306e\u3046\u3061\u3001Number\u3001String\u3001Boolean\u578b\u306b\u7126\u70b9\u3092\u5f53\u3066\u3001\u578b\u5909\u63db\u306e\u4ed5\u7d44\u307f\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>JavaScript\u306f\u52d5\u7684\u578b\u4ed8\u3051\u8a00\u8a9e\u3067\u3042\u308a\u3001\u5909\u6570\u306e\u578b\u306f\u5b9f\u884c\u6642\u306b\u6c7a\u5b9a\u3055\u308c\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u7570\u306a\u308b\u578b\u306e\u5024\u304c\u6df7\u5728\u3057\u3084\u3059\u304f\u3001\u6bd4\u8f03\u6f14\u7b97\u3084\u52a0\u7b97\u51e6\u7406\u306e\u524d\u5f8c\u3067\u6697\u9ed9\u7684\u306b\u578b\u5909\u63db\u304c\u8d77\u304d\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3046\u3057\u305f\u81ea\u52d5\u5909\u63db\u306e\u4ed5\u7d44\u307f\u306f\u4fbf\u5229\u3067\u3042\u308b\u4e00\u65b9\u3001\u610f\u56f3\u3057\u306a\u3044\u52d5\u4f5c\u3084\u30d0\u30b0\u306e\u539f\u56e0\u306b\u306a\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u578b\u5909\u63db\u306b\u306f\u3001\u660e\u793a\u7684\uff08\u4f8b\uff1aString()\u3084Number()\u306e\u4f7f\u7528\uff09\u3068\u6697\u9ed9\u7684\uff08\u4f8b\uff1a<code>+<\/code>\u3084<code>==<\/code>\u6f14\u7b97\u5b50\u306b\u3088\u308b\u81ea\u52d5\u5909\u63db\uff09\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u306e\u4ed5\u69d8\u3084\u7279\u5fb4\u3092\u6b63\u3057\u304f\u7406\u89e3\u3059\u308b\u3053\u3068\u3067\u3001\u53ef\u8aad\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3068\u610f\u56f3\u3069\u304a\u308a\u306e\u52d5\u4f5c\u3092\u4e21\u7acb\u3055\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\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\">\u660e\u793a\u7684\u306a\u578b\u5909\u63db\uff08\u30ad\u30e3\u30b9\u30c8\uff09<\/h3>\n\n\n\n<p>\u660e\u793a\u7684\u306a\u578b\u5909\u63db\u306f\u3001\u610f\u56f3\u7684\u306b\u578b\u3092\u5909\u3048\u305f\u3044\u3068\u304d\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002\u4ee3\u8868\u7684\u306a\u65b9\u6cd5\u3068\u3057\u3066\u306f\u3001<code>String()<\/code>\u3001<code>Number()<\/code>\u3001<code>Boolean()<\/code>\u306a\u3069\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u95a2\u6570\u3092\u4f7f\u3046\u65b9\u6cd5\u304c\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>\/\/ \u6570\u5024\u3092\u6587\u5b57\u5217\u306b\u5909\u63db\nconst num = 42;\nconst str = String(num);\nconsole.log(str); \/\/ \"42\"\nconsole.log(typeof str); \/\/ \"string\"\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: #6A9955\">\/\/ \u6570\u5024\u3092\u6587\u5b57\u5217\u306b\u5909\u63db<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4FC1FF\">num<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #B5CEA8\">42<\/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\">str<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #DCDCAA\">String<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">num<\/span><span style=\"color: #D4D4D4\">);<\/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\">str<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ &quot;42&quot;<\/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\">typeof<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">str<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ &quot;string&quot;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\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>\/\/ \u6587\u5b57\u5217\u3092\u6570\u5024\u306b\u5909\u63db\nconst input = \"3.14\";\nconst value = Number(input);\nconsole.log(value); \/\/ 3.14\nconsole.log(typeof value); \/\/ \"number\"\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: #6A9955\">\/\/ \u6587\u5b57\u5217\u3092\u6570\u5024\u306b\u5909\u63db<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4FC1FF\">input<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;3.14&quot;<\/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\">value<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #DCDCAA\">Number<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">input<\/span><span style=\"color: #D4D4D4\">);<\/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\">value<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ 3.14<\/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\">typeof<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">value<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ &quot;number&quot;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\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>\/\/ \u4efb\u610f\u306e\u5024\u3092\u771f\u507d\u5024\u306b\u5909\u63db\nconst flag = Boolean(0);\nconsole.log(flag); \/\/ false\nconsole.log(typeof flag); \/\/ \"boolean\"\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: #6A9955\">\/\/ \u4efb\u610f\u306e\u5024\u3092\u771f\u507d\u5024\u306b\u5909\u63db<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4FC1FF\">flag<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #DCDCAA\">Boolean<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">);<\/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\">flag<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ false<\/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\">typeof<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">flag<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ &quot;boolean&quot;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u6697\u9ed9\u7684\u306a\u578b\u5909\u63db\uff08\u578b\u5f37\u5236\uff09<\/h3>\n\n\n\n<p>\u6697\u9ed9\u7684\u306a\u578b\u5909\u63db\u306f\u3001\u6f14\u7b97\u5b50\u306e\u4f7f\u7528\u6642\u306b\u81ea\u52d5\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u3002\u7279\u306b\u3001<code>+<\/code> \u6f14\u7b97\u5b50\u306f\u52a0\u7b97\u3068\u9023\u7d50\u306e\u4e21\u65b9\u306e\u610f\u5473\u3092\u6301\u3064\u305f\u3081\u3001\u6ce8\u610f\u304c\u5fc5\u8981\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>console.log(1 + \"2\"); \/\/ \"12\"\uff08\u6570\u5024\u2192\u6587\u5b57\u5217\u306b\u5909\u63db\u3055\u308c\u3066\u9023\u7d50\uff09\nconsole.log(\"5\" * 2); \/\/ 10\uff08\u6587\u5b57\u5217\u2192\u6570\u5024\u306b\u5909\u63db\u3055\u308c\u3066\u4e57\u7b97\uff09\nconsole.log(false == 0); \/\/ true\uff08boolean\u2192number\u306b\u5909\u63db\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\">&quot;2&quot;<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ &quot;12&quot;\uff08\u6570\u5024\u2192\u6587\u5b57\u5217\u306b\u5909\u63db\u3055\u308c\u3066\u9023\u7d50\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\">&quot;5&quot;<\/span><span style=\"color: #D4D4D4\"> * <\/span><span style=\"color: #B5CEA8\">2<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ 10\uff08\u6587\u5b57\u5217\u2192\u6570\u5024\u306b\u5909\u63db\u3055\u308c\u3066\u4e57\u7b97\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\">false<\/span><span style=\"color: #D4D4D4\"> == <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ true\uff08boolean\u2192number\u306b\u5909\u63db\uff09<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u6f14\u7b97\u5b50\u306e\u5de6\u53f3\u306e\u578b\u306b\u5fdc\u3058\u3066\u5909\u63db\u304c\u767a\u751f\u3057\u307e\u3059\u304c\u3001\u6319\u52d5\u3092\u5b8c\u5168\u306b\u4e88\u6e2c\u3059\u308b\u306e\u306f\u56f0\u96e3\u3067\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u57fa\u672c\u7684\u306b\u306f\u660e\u793a\u7684\u5909\u63db\u3092\u63a8\u5968\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6bd4\u8f03\u6f14\u7b97\u5b50\u306b\u304a\u3051\u308b\u578b\u5909\u63db<\/h3>\n\n\n\n<p><code>==<\/code> \u306f\u578b\u3092\u81ea\u52d5\u5909\u63db\u3057\u3066\u6bd4\u8f03\u3092\u884c\u3046\u305f\u3081\u3001\u601d\u308f\u306c\u4e00\u81f4\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u53b3\u5bc6\u7b49\u4fa1\u6f14\u7b97\u5b50 <code>===<\/code> \u306e\u4f7f\u7528\u304c\u63a8\u5968\u3055\u308c\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(0 == \"0\");   \/\/ true\uff08\u578b\u304c\u7570\u306a\u308b\u304c\u6570\u5024\u5909\u63db\u3055\u308c\u3066\u4e00\u81f4\uff09\nconsole.log(0 === \"0\");  \/\/ false\uff08\u578b\u304c\u7570\u306a\u308b\u306e\u3067\u4e00\u81f4\u3057\u306a\u3044\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\">0<\/span><span style=\"color: #D4D4D4\"> == <\/span><span style=\"color: #CE9178\">&quot;0&quot;<\/span><span style=\"color: #D4D4D4\">);   <\/span><span style=\"color: #6A9955\">\/\/ true\uff08\u578b\u304c\u7570\u306a\u308b\u304c\u6570\u5024\u5909\u63db\u3055\u308c\u3066\u4e00\u81f4\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\">0<\/span><span style=\"color: #D4D4D4\"> === <\/span><span style=\"color: #CE9178\">&quot;0&quot;<\/span><span style=\"color: #D4D4D4\">);  <\/span><span style=\"color: #6A9955\">\/\/ false\uff08\u578b\u304c\u7570\u306a\u308b\u306e\u3067\u4e00\u81f4\u3057\u306a\u3044\uff09<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\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\u306b\u3088\u308b\u6697\u9ed9\u7684\u306a\u6587\u5b57\u5217\u9023\u7d50\u3092\u610f\u8b58\u305b\u305a\u4f7f\u3063\u3066\u3057\u307e\u3046\u30b1\u30fc\u30b9\u304c\u983b\u767a\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>Boolean(\"false\")<\/code> \u306f <code>true<\/code> \u3092\u8fd4\u3059\u305f\u3081\u3001\u6587\u5b57\u5217\u3068\u3057\u3066\u306e &#8220;false&#8221; \u304c\u507d\u3068\u306f\u9650\u3089\u306a\u3044\u70b9\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/li>\n\n\n\n<li><code>null<\/code> \u3068 <code>undefined<\/code> \u306f <code>==<\/code> \u3067\u306f\u7b49\u3057\u3044\u3068\u5224\u5b9a\u3055\u308c\u308b\u304c\u3001<code>===<\/code> \u3067\u306f\u7570\u306a\u308b\u305f\u3081\u3001\u610f\u56f3\u7684\u306b\u4f7f\u3044\u5206\u3051\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n\n\n\n<li>\u7a7a\u6587\u5b57\u5217\u3084\u7a7a\u914d\u5217\u3001<code>NaN<\/code> \u306a\u3069\u306e&#8221;Falsy&#8221;\u5024\u306f\u3001\u771f\u507d\u5024\u5909\u63db\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u305f\u3081\u3001\u6761\u4ef6\u5224\u5b9a\u306b\u4f7f\u3046\u969b\u306b\u306f\u6319\u52d5\u3092\u78ba\u8a8d\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/li>\n<\/ul>\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(Boolean(\"false\")); \/\/ true\nconsole.log(Boolean(\"\"));      \/\/ false\nconsole.log(Boolean([]));      \/\/ true\nconsole.log(Boolean(NaN));     \/\/ false\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: #DCDCAA\">Boolean<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;false&quot;<\/span><span style=\"color: #D4D4D4\">)); <\/span><span style=\"color: #6A9955\">\/\/ true<\/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: #DCDCAA\">Boolean<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;&quot;<\/span><span style=\"color: #D4D4D4\">));      <\/span><span style=\"color: #6A9955\">\/\/ false<\/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: #DCDCAA\">Boolean<\/span><span style=\"color: #D4D4D4\">([]));      <\/span><span style=\"color: #6A9955\">\/\/ true<\/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: #DCDCAA\">Boolean<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #569CD6\">NaN<\/span><span style=\"color: #D4D4D4\">));     <\/span><span style=\"color: #6A9955\">\/\/ false<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u307e\u3068\u3081<\/h2>\n\n\n\n<p>JavaScript\u3067\u306f\u3001\u660e\u793a\u7684\uff0f\u6697\u9ed9\u7684\u306a\u578b\u5909\u63db\u304c\u983b\u7e41\u306b\u767a\u751f\u3057\u307e\u3059\u3002\u3068\u304f\u306b\u52d5\u7684\u578b\u4ed8\u3051\u306b\u6163\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u6697\u9ed9\u5909\u63db\u306b\u8d77\u56e0\u3059\u308b\u30d0\u30b0\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u6f14\u7b97\u5b50\u3084\u6bd4\u8f03\u51e6\u7406\u3067\u610f\u56f3\u3057\u306a\u3044\u578b\u5909\u63db\u304c\u8d77\u3053\u3089\u306a\u3044\u3088\u3046\u3001\u57fa\u672c\u7684\u306b\u306f\u660e\u793a\u7684\u306a\u5909\u63db\u3092\u884c\u3044\u3001<code>===<\/code>\u3092\u4f7f\u3063\u305f\u53b3\u5bc6\u306a\u6bd4\u8f03\u3092\u5fc3\u304c\u3051\u308b\u3068\u5b89\u5168\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8 2. JavaScript\u306e\u30c7\u30fc\u30bf\u578b\u3068\u578b\u5909\u63db\u3068\u306f\uff1f JavaScript\u306b\u306f\u3001\u5927\u304d\u304f\u5206\u3051\u3066\u300c\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u300d\u3068\u300c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u578b\u300d\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u672c\u8a18\u4e8b\u3067\u306f\u3001\u5b9f\u52d9\u3067\u7279\u306b\u4f7f\u7528\u983b\u5ea6\u304c\u9ad8\u3044\u30d7\u30ea\u30df\u30c6\u30a3\u30d6\u578b\u306e\u3046 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":930,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[86],"tags":[],"class_list":["post-852","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\/852","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=852"}],"version-history":[{"count":2,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/852\/revisions"}],"predecessor-version":[{"id":931,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/852\/revisions\/931"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/media\/930"}],"wp:attachment":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}