{"id":3861,"date":"2021-07-21T19:14:48","date_gmt":"2021-07-21T10:14:48","guid":{"rendered":"https:\/\/auto-worker.com\/blog\/?p=3861"},"modified":"2023-08-29T21:30:17","modified_gmt":"2023-08-29T12:30:17","slug":"post-3861","status":"publish","type":"post","link":"https:\/\/auto-worker.com\/blog\/?p=3861","title":{"rendered":"GAS\u306e\u914d\u5217\u306e\u8981\u7d20\u306e\u4e26\u3073\u9806\u3092\u9006\u8ee2\u3055\u305b\u308b\u65b9\u6cd5(reverse\u30e1\u30bd\u30c3\u30c9)"},"content":{"rendered":"\n<p>Google Apps Script(GAS)\u3067\u914d\u5217\u3092\u6271\u3063\u3066\u3044\u308b\u3068\u3001\u8981\u7d20\u306e\u4e26\u3073\u3092\u9006\u9806\u306b\u4e26\u3073\u66ff\u3048\u305f\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u3001GAS\u306e\u914d\u5217\u306e\u8981\u7d20\u3092\u7c21\u5358\u306b\u9006\u8ee2\u3055\u305b\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GAS\u306e\u914d\u5217\u306e\u8981\u7d20\u3092\u9006\u9806\u306b<\/h2>\n\n\n\n<p>Google Apps Script(GAS)\u3067\u306f\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3084\u5404\u7a2eAPI\u304b\u3089\u5024\u3092\u53d6\u5f97\u3059\u308b\u969b\u3001\u3088\u304f\u914d\u5217\u306b\u5024\u3092\u683c\u7d0d\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5024\u3092\u683c\u7d0d\u3059\u308b\u5909\u6570\u3088\u308a\u3082\u914d\u5217\u306e\u65b9\u304c\u30c7\u30fc\u30bf\u3092for\u30eb\u30fc\u30d7\u306a\u3069\u3067\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3067\u304d\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<p>API\u304b\u3089\u5024\u3092\u53d6\u5f97\u3057\u305f\u969b\u306b\u3001\u914d\u5217\u306e\u8981\u7d20\u306e\u4e26\u3073\u66ff\u3048\u305f\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">reverse\u30e1\u30bd\u30c3\u30c9\u3067\u914d\u5217\u8981\u7d20\u3092\u9006\u8ee2<\/h2>\n\n\n\n<p>Google Apps Script(GAS)\u306b\u306f\u3001\u914d\u5217\u306e\u8981\u7d20\u306e\u9806\u756a\u3092\u9006\u8ee2\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>JavaScript\u3067\u3082\u914d\u5217\u306eArray\u30af\u30e9\u30b9\u3067\u5229\u7528\u53ef\u80fd\u306areverse\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<p><em><strong>Array.reverse()<\/strong><\/em><\/p>\n\n\n\n<p>reverse\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u914d\u5217\u306e\u8981\u7d20\u306e\u9806\u756a\u3092\u9006\u8ee2\u3057\u305f\u914d\u5217\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GAS\u306e\u914d\u5217\u8981\u7d20\u3092\u9006\u9806\u306b\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h2>\n\n\n\n<p>\u5b9f\u969b\u306bGoogle Apps Script(GAS)\u3067reverse\u30e1\u30bd\u30c3\u30c9\u3092\u5229\u7528\u3057\u3066\u3001\u914d\u5217\u8981\u7d20\u306e\u9806\u756a\u3092\u9006\u9806\u306b\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u679c\u7269\u306e\u540d\u524d\u3092\u683c\u7d0d\u3057\u305f1\u6b21\u5143\u914d\u5217\u3092\u5b9a\u7fa9\u3057\u305f\u3042\u3068\u3001reverse\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u8981\u7d20\u306e\u4e26\u3073\u3092\u9006\u8ee2\u3055\u305b\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-javascript\"><code class=\"language-javascript\">function myFunction() {\n  \/\/1\u6b21\u5143\u914d\u5217\u3092\u5b9a\u7fa9\n  let fruits = [\"\u308a\u3093\u3054\", \"\u307f\u304b\u3093\", \"\u3044\u3061\u3054\"];\n  \/\/\u8981\u7d20\u306e\u9806\u756a\u3092\u5b9f\u884c\u30ed\u30b0\u3067\u78ba\u8a8d\n  console.log(fruits);\n  \/\/reverse\u30e1\u30bd\u30c3\u30c9\u3067\u8981\u7d20\u3092\u9006\u9806\u306b\u5909\u66f4\n  fruits = fruits.reverse();\n  \/\/\u518d\u5ea6\u3001\u8981\u7d20\u306e\u9806\u756a\u3092\u5b9f\u884c\u30ed\u30b0\u3067\u78ba\u8a8d\n  console.log(fruits);\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"613\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_001.jpg\" alt=\"Google Apps Script(GAS)\u306e\u914d\u5217\u3067\u3001\u8981\u7d20\u3092\u9006\u9806\u306b\u9006\u8ee2\u3055\u305b\u308breverse\u30e1\u30bd\u30c3\u30c9\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\" class=\"wp-image-3889\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_001.jpg 1200w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_001-300x153.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_001-768x392.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_001-1024x523.jpg 1024w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_001-530x271.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_001-565x289.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_001-710x363.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_001-725x370.jpg 725w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>\u5b9f\u884c\u30ed\u30b0\u3067\u51fa\u529b\u3055\u308c\u308b\u914d\u5217\u306e\u8981\u7d20\u306e\u4e26\u3073\u304c\u3001\u6700\u521d\u3068reverse\u30e1\u30bd\u30c3\u30c9\u3092\u5229\u7528\u3057\u305f\u5f8c\u3067\u306f\u9006\u8ee2\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306bGAS\u3067reverse\u30e1\u30bd\u30c3\u30c9\u3092\u914d\u5217\u3067\u4f7f\u7528\u3059\u308b\u3068\u3001\u8981\u7d20\u306e\u9806\u756a\u3092\u9006\u9806\u306b\u5165\u308c\u66ff\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GAS\u306e2\u6b21\u5143\u914d\u5217\u3067reverse\u30e1\u30bd\u30c3\u30c9\u3067\u9006\u8ee2\u3059\u308b\u3068\uff1f<\/h2>\n\n\n\n<p>\u5148\u7a0bGoogle Apps Script(GAS)\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u7d39\u4ecb\u3057\u305f\u306e\u306f\u30011\u6b21\u5143\u914d\u5217\u3092reverse\u30e1\u30bd\u30c3\u30c9\u3067\u8981\u7d20\u306e\u9806\u756a\u3092\u9006\u8ee2\u3055\u305b\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3067\u306f\u30012\u6b21\u5143\u914d\u5217\u3067\u3082reverse\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3067\u304d\u308b\u306e\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p>\u5b9f\u306f2\u6b21\u5143\u914d\u5217\u3067\u3082reverse\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u306f\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"609\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_002.jpg\" alt=\"Google Apps Script(GAS)\u306e2\u6b21\u5143\u914d\u5217\u3067reverse\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u3053\u3068\u3067\u3001\u8981\u7d20\u306e\u9806\u756a\u3092\u9006\u8ee2\u53ef\u80fd\u306b\" class=\"wp-image-3890\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_002.jpg 1200w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_002-300x152.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_002-768x390.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_002-1024x520.jpg 1024w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_002-530x269.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_002-565x287.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_002-710x360.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2021\/07\/20210721_auto_002-725x368.jpg 725w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>2\u6b21\u5143\u914d\u5217\u3067reverse\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u30011\u6b21\u5143\u76ee(\u884c\u65b9\u5411)\u306b\u8981\u7d20\u306e\u9806\u756a\u304c\u9006\u9806\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u30012\u6b21\u5143\u76ee(\u5217\u65b9\u5411)\u306e\u8981\u7d20\u306b\u3064\u3044\u3066\u306f\u9006\u8ee2\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u3082\u3057\u30012\u6b21\u5143\u76ee\u306e\u8981\u7d20\u9806\u3092\u9006\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u30011\u6b21\u5143\u76ee\u3092\u6307\u5b9a\u3057\u305f\u4e0a\u3067\u3001reverse\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e2\u6b21\u5143\u914d\u5217animal\u3067\u30012\u756a\u76ee\u306e\u4e26\u3073\u3092\u9006\u9806\u306b\u3059\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong><em>animal[1] = animal[1].reverse();<\/em><\/strong><\/p>\n\n\n\n<p>\u4ee5\u4e0a\u304b\u3089\u3001GAS\u3067\u306f2\u6b21\u5143\u914d\u5217\u3067\u3082reverse\u30e1\u30bd\u30c3\u30c9\u306b\u3088\u308b\u8981\u7d20\u306e\u9806\u756a\u3092\u9006\u8ee2\u3055\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u914d\u5217\u66f8\u304d\u8fbc\u307f<\/h2>\n\n\n\n<p>Google Apps Script(GAS)\u3067\u8981\u7d20\u306e\u9806\u756a\u3092\u9006\u9806\u306b\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u3068\u3057\u3066\u306f\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3078\u306e\u914d\u5217\u66f8\u304d\u8fbc\u307f\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u8907\u6570\u7bc4\u56f2\u306e\u30bb\u30eb\u306b\u5024\u3092\u66f8\u304d\u8fbc\u3080\u5834\u5408\u3001setValues\u30e1\u30bd\u30c3\u30c9\u30672\u6b21\u5143\u914d\u5217\u3092\u6307\u5b9a\u3057\u3066\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3001\u30bb\u30eb\u306e\u66f8\u304d\u8fbc\u3080\u4f4d\u7f6e\u3092\u9006\u9806\u306b\u3057\u305f\u3044\u5834\u5408\u3001\u66f8\u304d\u8fbc\u3080\u524d\u306b2\u6b21\u5143\u914d\u5217\u3067\u9806\u756a\u3092\u9006\u8ee2\u3057\u3066\u304a\u3051\u3070\u3001\u3042\u3068\u3067\u5909\u66f4\u3059\u308b\u624b\u9593\u304c\u4e0d\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3046\u3057\u305f\u70b9\u304b\u3089\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u30672\u6b21\u5143\u914d\u5217\u3092\u51fa\u529b\u3059\u308b\u969b\u306b\u3001\u9006\u9806\u3067\u4e26\u3079\u305f\u3044\u5834\u5408\u306breverse\u30e1\u30bd\u30c3\u30c9\u304c\u6709\u7528\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081\u30fb\u7d42\u308f\u308a\u306b<\/h2>\n\n\n\n<p>\u4eca\u56de\u3001Google Apps Script(GAS)\u3067\u914d\u5217\u306e\u8981\u7d20\u3092\u9006\u9806\u306b\u4e26\u3073\u66ff\u3048\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u307e\u307e\u914d\u5217\u8981\u7d20\u3092\u9006\u8ee2\u3055\u305b\u3088\u3046\u3068\u3059\u308b\u3068\u3001for\u30eb\u30fc\u30d7\u306a\u3069\u3067\u4e26\u3073\u66ff\u3048\u51e6\u7406\u3092\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001reverse\u30e1\u30bd\u30c3\u30c9\u3092\u5229\u7528\u3059\u308c\u3070\u30011\u884c\u306e\u30b3\u30fc\u30c9\u914d\u5217\u306e\u8981\u7d20\u3092\u9006\u9806\u306b\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u6700\u7d42\u7684\u306a\u30a2\u30a6\u30c8\u30d7\u30c3\u30c8\u3092\u5143\u3005\u306e\u30c7\u30fc\u30bf\u3068\u9806\u756a\u3092\u9006\u8ee2\u3055\u305b\u305f\u3044\u5834\u5408\u306b\u3001reverse\u30e1\u30bd\u30c3\u30c9\u304c\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<p>GAS\u3067\u914d\u5217\u306e\u8981\u7d20\u306e\u9806\u756a\u3092\u9006\u8ee2\u3055\u305b\u305f\u3044\u5834\u5408\u306b\u3001\u4eca\u56de\u7d39\u4ecb\u3057\u305freverse\u30e1\u30bd\u30c3\u30c9\u3092\u6d3b\u7528\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Apps Script(GAS)\u3067\u914d\u5217\u3092\u6271\u3063\u3066\u3044\u308b\u3068\u3001\u8981\u7d20\u306e\u4e26\u3073\u3092\u9006\u9806\u306b\u4e26\u3073\u66ff\u3048\u305f\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002 \u305d\u3053\u3067\u3001GAS\u306e\u914d\u5217\u306e\u8981\u7d20\u3092\u7c21\u5358\u306b\u9006\u8ee2\u3055\u305b\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002 GAS\u306e\u914d\u5217\u306e\u8981\u7d20\u3092\u9006\u9806\u306b Google [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3889,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[14,707,706,689],"class_list":["post-3861","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gas","tag-gas","tag-reverse","tag-706","tag-689"],"_links":{"self":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3861"}],"version-history":[{"count":7,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3861\/revisions"}],"predecessor-version":[{"id":8086,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3861\/revisions\/8086"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/3889"}],"wp:attachment":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}