{"id":862,"date":"2025-08-05T16:47:32","date_gmt":"2025-08-05T07:47:32","guid":{"rendered":"https:\/\/nexive.tech\/?p=862"},"modified":"2025-08-05T16:47:33","modified_gmt":"2025-08-05T07:47:33","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%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88%e3%83%aa%e3%83%86%e3%83%a9%e3%83%ab%e3%81%ae%e4%be%bf%e5%88%a9","status":"publish","type":"post","link":"https:\/\/nexive.tech\/?p=862","title":{"rendered":"\u3010\u30b5\u30af\u30c3\u3068\u89e3\u8aac\u3011JavaScript \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\u306e\u4fbf\u5229\u306a\u4f7f\u3044\u65b9"},"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>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\u306e\u57fa\u672c\u69cb\u6587\u3068\u4f7f\u3044\u6240\u3092\u5b9f\u4f8b\u3067\u78ba\u8a8d<\/li>\n\n\n\n<li>\u30cd\u30b9\u30c8\u3001\u6761\u4ef6\u5206\u5c90\u3001\u95a2\u6570\u547c\u3073\u51fa\u3057\u306a\u3069\u5fdc\u7528\u7684\u306a\u4f7f\u3044\u65b9\u3092\u7d39\u4ecb<\/li>\n\n\n\n<li>\u5b9f\u52d9\u3067\u3042\u308a\u304c\u3061\u306a\u8aa4\u7528\u3084\u843d\u3068\u3057\u7a74\u306b\u3082\u6ce8\u610f<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">2. \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>JavaScript\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\uff08template literal\uff09\u306f\u3001ES2015\uff08ES6\uff09\u3067\u5c0e\u5165\u3055\u308c\u305f\u6587\u5b57\u5217\u8a18\u6cd5\u306e\u4e00\u7a2e\u3067\u3001\u30d0\u30c3\u30af\u30af\u30a9\u30fc\u30c8\uff08&#8220;\uff09\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u3092\u56f2\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5f93\u6765\u306e\u6587\u5b57\u5217\u7d50\u5408\uff08+\u6f14\u7b97\u5b50\uff09\u306b\u6bd4\u3079\u3066\u3001\u53ef\u8aad\u6027\u304c\u9ad8\u304f\u67d4\u8edf\u306a\u6587\u5b57\u5217\u69cb\u7bc9\u304c\u53ef\u80fd\u3067\u3059\u3002\u7279\u306b\u4ee5\u4e0b\u306e3\u70b9\u3067\u5b9f\u52d9\u7684\u306b\u6709\u7528\u3067\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5909\u6570\u57cb\u3081\u8fbc\u307f\uff08\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\uff09<\/li>\n\n\n\n<li>\u8907\u6570\u884c\u6587\u5b57\u5217\u306e\u8a18\u8ff0<\/li>\n\n\n\n<li>\u5f0f\u3084\u95a2\u6570\u547c\u3073\u51fa\u3057\u3092\u57cb\u3081\u8fbc\u3093\u3060\u8868\u73fe<\/li>\n<\/ul>\n\n\n\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\u306f\u4e3b\u306b\u30ed\u30b0\u51fa\u529b\u3001HTML\u69cb\u7bc9\u3001SQL\u30af\u30a8\u30ea\u751f\u6210\u3001API\u30e1\u30c3\u30bb\u30fc\u30b8\u6574\u5f62\u306a\u3069\u306b\u4f7f\u308f\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\">\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\uff1a\u5909\u6570\u57cb\u3081\u8fbc\u307f<\/h3>\n\n\n\n<p>\u5909\u6570\u3092\u57cb\u3081\u8fbc\u3093\u3067\u6587\u5b57\u5217\u3092\u69cb\u7bc9\u3059\u308b\u969b\u306b\u3001\u53ef\u8aad\u6027\u306e\u9ad8\u3044\u8a18\u8ff0\u304c\u53ef\u80fd\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 name = \"\u5c71\u7530\";\nconst message = `\u3053\u3093\u306b\u3061\u306f\u3001${name}\u3055\u3093\uff01`;\nconsole.log(message); \/\/ => \u3053\u3093\u306b\u3061\u306f\u3001\u5c71\u7530\u3055\u3093\uff01\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\">name<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;\u5c71\u7530&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\">message<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">`\u3053\u3093\u306b\u3061\u306f\u3001<\/span><span style=\"color: #569CD6\">${<\/span><span style=\"color: #9CDCFE\">name<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\">\u3055\u3093\uff01`<\/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\">message<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ =&gt; \u3053\u3093\u306b\u3061\u306f\u3001\u5c71\u7530\u3055\u3093\uff01<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p><code>${}<\/code> \u306e\u4e2d\u3067\u306f\u4efb\u610f\u306e\u5f0f\u304c\u5229\u7528\u3067\u304d\u3001\u95a2\u6570\u3084\u8a08\u7b97\u3082\u542b\u3081\u3089\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>const price = 1200;\nconst taxRate = 0.1;\nconst total = `\u7a0e\u8fbc\u4fa1\u683c\u306f${price * (1 + taxRate)}\u5186\u3067\u3059\u3002`;\nconsole.log(total); \/\/ => \u7a0e\u8fbc\u4fa1\u683c\u306f1320\u5186\u3067\u3059\u3002\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\">price<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #B5CEA8\">1200<\/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\">taxRate<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #B5CEA8\">0.1<\/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\">total<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">`\u7a0e\u8fbc\u4fa1\u683c\u306f<\/span><span style=\"color: #569CD6\">${<\/span><span style=\"color: #9CDCFE\">price<\/span><span style=\"color: #D4D4D4\"> * (<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\"> + <\/span><span style=\"color: #9CDCFE\">taxRate<\/span><span style=\"color: #D4D4D4\">)<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\">\u5186\u3067\u3059\u3002`<\/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\">total<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ =&gt; \u7a0e\u8fbc\u4fa1\u683c\u306f1320\u5186\u3067\u3059\u3002<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u8907\u6570\u884c\u6587\u5b57\u5217\u306e\u6574\u5f62<\/h3>\n\n\n\n<p>\u6539\u884c\u3092\u542b\u3080\u6587\u5b57\u5217\u3082\u305d\u306e\u307e\u307e\u8a18\u8ff0\u53ef\u80fd\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 html = `\n  &lt;div>\n    &lt;p>Hello&lt;\/p>\n  &lt;\/div>\n`;\nconsole.log(html);\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\">html<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">`<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">  &lt;div&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">    &lt;p&gt;Hello&lt;\/p&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">  &lt;\/div&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #CE9178\">`<\/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\">html<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u5f93\u6765\u306e <code>\\n<\/code> \u3068 <code>+<\/code> \u3092\u4f7f\u3063\u305f\u66f8\u304d\u65b9\u306b\u6bd4\u3079\u3066\u660e\u78ba\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30cd\u30b9\u30c8\u3084\u6761\u4ef6\u5f0f\u3092\u542b\u3081\u308b<\/h3>\n\n\n\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\u5185\u306b\u6761\u4ef6\u5f0f\u3092\u7d44\u307f\u8fbc\u3080\u3053\u3068\u3067\u67d4\u8edf\u306a\u6574\u5f62\u304c\u53ef\u80fd\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 isMember = true;\nconst fee = `\u6599\u91d1\uff1a${isMember ? '500\u5186' : '1000\u5186'}`;\nconsole.log(fee); \/\/ => \u6599\u91d1\uff1a500\u5186\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\">isMember<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #569CD6\">true<\/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\">fee<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">`\u6599\u91d1\uff1a<\/span><span style=\"color: #569CD6\">${<\/span><span style=\"color: #9CDCFE\">isMember<\/span><span style=\"color: #D4D4D4\"> ? <\/span><span style=\"color: #CE9178\">&#39;500\u5186&#39;<\/span><span style=\"color: #D4D4D4\"> : <\/span><span style=\"color: #CE9178\">&#39;1000\u5186&#39;<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\">`<\/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\">fee<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ =&gt; \u6599\u91d1\uff1a500\u5186<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u95a2\u6570\u547c\u3073\u51fa\u3057\u306e\u7d50\u679c\u3092\u57cb\u3081\u8fbc\u3080\u3053\u3068\u3082\u3067\u304d\u307e\u3059\uff1a<\/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>function formatName(first, last) {\n  return `${last} ${first}`;\n}\nconst greeting = `\u3088\u3046\u3053\u305d\u3001${formatName('\u592a\u90ce', '\u5c71\u7530')}\u3055\u3093\uff01`;\nconsole.log(greeting); \/\/ => \u3088\u3046\u3053\u305d\u3001\u5c71\u7530 \u592a\u90ce\u3055\u3093\uff01\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\">function<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">formatName<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">first<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">last<\/span><span style=\"color: #D4D4D4\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #CE9178\">`<\/span><span style=\"color: #569CD6\">${<\/span><span style=\"color: #9CDCFE\">last<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\"> <\/span><span style=\"color: #569CD6\">${<\/span><span style=\"color: #9CDCFE\">first<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\">`<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><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\">greeting<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">`\u3088\u3046\u3053\u305d\u3001<\/span><span style=\"color: #569CD6\">${<\/span><span style=\"color: #DCDCAA\">formatName<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&#39;\u592a\u90ce&#39;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&#39;\u5c71\u7530&#39;<\/span><span style=\"color: #D4D4D4\">)<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\">\u3055\u3093\uff01`<\/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\">greeting<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ =&gt; \u3088\u3046\u3053\u305d\u3001\u5c71\u7530 \u592a\u90ce\u3055\u3093\uff01<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u30bf\u30b0\u4ed8\u304d\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u3088\u308b\u52a0\u5de5\u51e6\u7406<\/h3>\n\n\n\n<p>\u30bf\u30b0\u95a2\u6570\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u5404\u90e8\u5206\u3092\u81ea\u5728\u306b\u52a0\u5de5\u3067\u304d\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>function upper(strings, ...values) {\n  return strings&#91;0&#93; + values&#91;0&#93;.toUpperCase() + strings&#91;1&#93;;\n}\nconst result = upper`\u3053\u3093\u306b\u3061\u306f\u3001${\"\u3084\u307e\u3060\"}\u3055\u3093\u3002`;\nconsole.log(result); \/\/ => \u3053\u3093\u306b\u3061\u306f\u3001\u30e4\u30de\u30c0\u3055\u3093\u3002\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\">function<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">upper<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">strings<\/span><span style=\"color: #D4D4D4\">, ...<\/span><span style=\"color: #9CDCFE\">values<\/span><span style=\"color: #D4D4D4\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">  <\/span><span style=\"color: #C586C0\">return<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">strings<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">&#93; + <\/span><span style=\"color: #9CDCFE\">values<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">&#93;.<\/span><span style=\"color: #DCDCAA\">toUpperCase<\/span><span style=\"color: #D4D4D4\">() + <\/span><span style=\"color: #9CDCFE\">strings<\/span><span style=\"color: #D4D4D4\">&#91;<\/span><span style=\"color: #B5CEA8\">1<\/span><span style=\"color: #D4D4D4\">&#93;;<\/span><\/span>\n<span class=\"line\"><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\">result<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #DCDCAA\">upper<\/span><span style=\"color: #CE9178\">`\u3053\u3093\u306b\u3061\u306f\u3001<\/span><span style=\"color: #569CD6\">${<\/span><span style=\"color: #CE9178\">&quot;\u3084\u307e\u3060&quot;<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\">\u3055\u3093\u3002`<\/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\">result<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ =&gt; \u3053\u3093\u306b\u3061\u306f\u3001\u30e4\u30de\u30c0\u3055\u3093\u3002<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u69cb\u6587\u7684\u306b\u6271\u3044\u305f\u3044\u30b1\u30fc\u30b9\uff08\u56fd\u969b\u5316\u3084\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u51e6\u7406\u306a\u3069\uff09\u3067\u6709\u52b9\u3067\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<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\u3067\u306f\u3001\u30d0\u30c3\u30af\u30af\u30a9\u30fc\u30c8\uff08`\uff09\u306e\u4f7f\u7528\u30df\u30b9\u304c\u983b\u767a\u3057\u307e\u3059\u3002\u7279\u306b\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3084\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u3068\u6df7\u540c\u3057\u3001<code>${}<\/code> \u304c\u6587\u5b57\u5217\u4e2d\u306b\u5c55\u958b\u3055\u308c\u306a\u3044\u30c8\u30e9\u30d6\u30eb\u304c\u591a\u3044\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 name = \"\u4f50\u85e4\";\nconst wrong = '\u3053\u3093\u306b\u3061\u306f\u3001${name}\u3055\u3093';\nconsole.log(wrong); \/\/ => \u3053\u3093\u306b\u3061\u306f\u3001${name}\u3055\u3093\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\">name<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;\u4f50\u85e4&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\">wrong<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&#39;\u3053\u3093\u306b\u3061\u306f\u3001${name}\u3055\u3093&#39;<\/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\">wrong<\/span><span style=\"color: #D4D4D4\">); <\/span><span style=\"color: #6A9955\">\/\/ =&gt; \u3053\u3093\u306b\u3061\u306f\u3001${name}\u3055\u3093<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u307e\u305f\u3001\u8907\u96d1\u306a\u5f0f\u3092 <code>${}<\/code> \u306b\u57cb\u3081\u8fbc\u307f\u3059\u304e\u308b\u3068\u53ef\u8aad\u6027\u304c\u4f4e\u4e0b\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51e6\u7406\u306f\u4e8b\u524d\u306b\u5909\u6570\u5316\u3059\u308b\u306e\u304c\u671b\u307e\u3057\u3044\u3067\u3059\uff1a<\/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>\/\/ \u60aa\u3044\u4f8b\nconst message = `\u5408\u8a08\uff1a${items.reduce((sum, item) => sum + item.price, 0)}\u5186`;\n\n\/\/ \u826f\u3044\u4f8b\nconst total = items.reduce((sum, item) => sum + item.price, 0);\nconst message = `\u5408\u8a08\uff1a${total}\u5186`;\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\">\/\/ \u60aa\u3044\u4f8b<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4FC1FF\">message<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">`\u5408\u8a08\uff1a<\/span><span style=\"color: #569CD6\">${<\/span><span style=\"color: #9CDCFE\">items<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">reduce<\/span><span style=\"color: #D4D4D4\">((<\/span><span style=\"color: #9CDCFE\">sum<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">item<\/span><span style=\"color: #D4D4D4\">) <\/span><span style=\"color: #569CD6\">=&gt;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">sum<\/span><span style=\"color: #D4D4D4\"> + <\/span><span style=\"color: #9CDCFE\">item<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">price<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #B5CEA8\">0<\/span><span style=\"color: #D4D4D4\">)<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\">\u5186`<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u826f\u3044\u4f8b<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4FC1FF\">total<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">items<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">reduce<\/span><span style=\"color: #D4D4D4\">((<\/span><span style=\"color: #9CDCFE\">sum<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">item<\/span><span style=\"color: #D4D4D4\">) <\/span><span style=\"color: #569CD6\">=&gt;<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">sum<\/span><span style=\"color: #D4D4D4\"> + <\/span><span style=\"color: #9CDCFE\">item<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">price<\/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: #569CD6\">const<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4FC1FF\">message<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">`\u5408\u8a08\uff1a<\/span><span style=\"color: #569CD6\">${<\/span><span style=\"color: #9CDCFE\">total<\/span><span style=\"color: #569CD6\">}<\/span><span style=\"color: #CE9178\">\u5186`<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u30bf\u30b0\u4ed8\u304d\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306f\u6587\u6cd5\u7684\u306b\u7279\u6b8a\u3067\u3001\u526f\u4f5c\u7528\u3092\u4f34\u3046\u95a2\u6570\u3092\u7d44\u307f\u8fbc\u3080\u3068\u4e88\u671f\u3057\u306a\u3044\u6319\u52d5\u306b\u306a\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002\u4f7f\u7528\u6642\u306f\u95a2\u6570\u8a2d\u8a08\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\u306f\u3001\u5909\u6570\u57cb\u3081\u8fbc\u307f\u3001\u8907\u6570\u884c\u8a18\u8ff0\u3001\u95a2\u6570\u547c\u3073\u51fa\u3057\u306a\u3069\u3092\u7c21\u6f54\u306b\u8a18\u8ff0\u3067\u304d\u308b\u8868\u73fe\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u69cb\u6587\u30df\u30b9\u3084\u904e\u5ea6\u306a\u57cb\u3081\u8fbc\u307f\u306b\u6ce8\u610f\u3059\u308c\u3070\u3001\u5b9f\u52d9\u3067\u3082\u53ef\u8aad\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7279\u306b\u30bf\u30b0\u4ed8\u304d\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u6d3b\u7528\u306f\u3084\u3084\u9ad8\u5ea6\u3067\u3059\u304c\u3001\u9069\u5207\u306b\u4f7f\u3048\u3070\u67d4\u8edf\u306a\u6574\u5f62\u51e6\u7406\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u672c\u8a18\u4e8b\u306e\u30dd\u30a4\u30f3\u30c8 2. \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\u3068\u306f\uff1f JavaScript\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30ea\u30c6\u30e9\u30eb\uff08template literal\uff09\u306f\u3001ES2015\uff08ES6\uff09\u3067\u5c0e\u5165\u3055\u308c\u305f\u6587\u5b57\u5217\u8a18\u6cd5\u306e\u4e00\u7a2e\u3067\u3001\u30d0\u30c3\u30af\u30af\u30a9\u30fc\u30c8\uff08&#038;#822 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":940,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[86],"tags":[],"class_list":["post-862","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\/862","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=862"}],"version-history":[{"count":2,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/862\/revisions"}],"predecessor-version":[{"id":941,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/posts\/862\/revisions\/941"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=\/wp\/v2\/media\/940"}],"wp:attachment":[{"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nexive.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}