Google Apps Scriptで使えるJSのバージョンについて調査

# はじめに
未来になると拡張されてると思うので __2019/02/27__ 時点での話です。

# 対応しているバージョン

- https://developers.google.com/apps-script/guides/services/#basic_javascript_features
- 公式にはJavaScript 1.6をベースにしていて1.7と1.8のfeatureも少し入ってるよ、というアナウンス
    - 何が入ってて何が入ってないは書いていないので読者の想像に任せられている... :hankey: 
- :arrow_up: の記事から各バージョンへのリンクはMDNに向けて貼られているのでMDNでのスペックで調べてます

## [1.6](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.6)

|feature|対応状況|
| --- | --- |
| [E4X](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.6#E4X) | :o: |
| [Arrayの拡張](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.6#Array_.E3.81.AE.E6.8B.A1.E5.BC.B5) | :o: |
| [Array および String の汎用化](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.6#Array_.E3.81.8A.E3.82.88.E3.81.B3_String_.E3.81.AE.E6.B1.8E.E7.94.A8.E5.8C.96) | :o:  |


## [1.7](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.7)

|feature|対応状況|
| --- | --- |
| [ジェネレータ (yield)](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.7#.E3.82.B8.E3.82.A7.E3.83.8D.E3.83.AC.E3.83.BC.E3.82.BF) | :x:  |
| [イテレータ](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.7#.E3.82.A4.E3.83.86.E3.83.AC.E3.83.BC.E3.82.BF) | :o:  |
| [配列内包](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.7#.E9.85.8D.E5.88.97.E5.86.85.E5.8C.85) | :o:  |
| [let](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.7#let_.E3.82.92.E4.BD.BF.E3.81.A3.E3.81.9F.E3.83.96.E3.83.AD.E3.83.83.E3.82.AF.E3.82.B9.E3.82.B3.E3.83.BC.E3.83.97) | :x:  |
| [分割代入](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.7#.E5.88.86.E5.89.B2.E4.BB.A3.E5.85.A5) |  :o: |

## [1.8](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.8)

[1.8.1](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.8.1)と[1.8.5](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.8.5)のfeatureも含む

|feature|対応状況|
| --- | --- |
| [式クロージャ](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.8#.E5.BC.8F.E3.82.AF.E3.83.AD.E3.83.BC.E3.82.B8.E3.83.A3) | :x: |
| [ジェネレータ式](https://developer.mozilla.org/ja/docs/Web/JavaScript/New_in_JavaScript/1.8#.E3.82.B8.E3.82.A7.E3.83.8D.E3.83.AC.E3.83.BC.E3.82.BF.E5.BC.8F) | :x: |
| [Array.reduce](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) | :o: |
| [Array.reduceLight](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight) | :o: | 
| [Object.getPrototypeOf](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Object/GetPrototypeOf) | :o: |
| [Using Native JSON](https://developer.mozilla.org/ja/docs/Using_native_JSON) | :o: |
| [Object.create](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Object/create) | :o: |
| [Object.defineProperty](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/defineProperty) | :o:  |
| [Object.defineProperties](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/defineProperties)] | :o: |
| [Object.getOwnPropertyDescriptor](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor) | :o: |
| [Object.keys](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/keys) | :o: |
| [Object.getOwnPropertyNames](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames) | :o: |
| [Object.preventExtensions](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/preventExtensions) | :o:  |
| [Object.isExtensible](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/isExtensible) | :o: |
| [Object.seal](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/seal) | :o: |
| [Object.isSealed](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/isSealed) | :o: |
| [Object.freeze](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/freeze) | :o: |
| [Object.isFrozen](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Object/isFrozen) | :o: |
| [Array.isArray](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Array/isArray) | :o: |
| [Date.toJSON](https://developer.mozilla.org/ja/docs/JavaScript/Reference/Global_Objects/Date/toJSON) | :o: |
| [getter](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Functions/get)/[setter](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Functions/set) | :o: |
| [strictモードのサポート](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Strict_mode)| :question:  |
| [Proxy](https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Proxy) | :x: |

# まとめ

- 意外と対応していたのでGASがんばってる
- polyfillが使えないんでES7で入った仕様とかはGASだと現状は動きません :cry: 
    - たとえば `Array.prototype.includes`
- strictモードのサポートが :question: になっているのはちゃんとエラーになるケースならないケースがあったので部分的に対応してるようだったからです