リリース日 | ランタイム | JavaScript仕様 |
---|---|---|
2009年08月19日 | Rhino | ES5 |
2020年02月06日 | V8 | ECMAScript |
ランタイム | スクリプト | ライブラリ | 実行可否 |
---|---|---|---|
Rhino | ES5 | ES5 | ✅ |
Rhino | ES5 | ECMAScript | ❌ |
Rhino | ECMAScript | ES5 | ❌ |
Rhino | ECMAScript | ECMAScript | ❌ |
V8 | ES5 | ES5 | ✅ |
V8 | ES5 | ECMAScript | ✅ |
V8 | ECMAScript | ES5 | ✅ |
V8 | ECMAScript | ECMAScript | ✅ |
アノテーション | 概要 |
---|---|
@param | 引数の型、名称、説明 |
@return | 戻り値の型、説明 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 変数の説明 */ | |
var variable1 = false | |
/** 変数の説明 */ | |
let variable2 = false | |
/** 定数の説明 */ | |
const CONSTANT1 = false | |
/** | |
* 関数の説明 | |
* @param {int} arg1 - 引数の説明 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
funtion myFunction() { | |
let foo = 'var' // letは対応していないためエラー | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let teamDrive1 = TeamDriveLibrary.create('共有ドライブ1') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1年半後を取得 | |
var dt = new Date() | |
dt.setMonth(dt.getMonth() + 18) | |
// YYYY/MM/DDで出力 | |
var ymd = dt.getFullYear() + '/' + (('0' + (dt.getMonth() + 1)).slice(-2)) + '/' + (('0' + dt.getDate()).slice(-2)) | |
console.log(ymd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1年半後を取得 | |
var dt = moment().add(18, 'months') | |
// 1年半後をYYYY/MM/DDで出力 | |
var ymd = dt.format("YYYY/MM/DD") | |
console.log(ymd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo { | |
static hoge() { | |
console.log('Foo#hoge()') | |
return true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(Lib.Foo) // undefined | |
const foo = new Lib.Foo() // エラー | |
console.log(Lib.Foo.hoge()) // エラー |
OlderNewer