all collections mutable class AbstractMap { // A FixedMap, not necessarily fresh, whose state is this map's current // state. snapshot() :FixedMap; // A fresh Map whose initial state is this map's current state. diverge() :Map; // A ReadOnlyMap, not necessarily fresh, whose state is a read only // view of this map's current state. readOnlyView() :ReadOnlyMap(); // query-only methods of Map ... } マスタの管理とかがしやすくなるよ! ReadOnlyMap, FixedMap 例としてMap
{ console.log(`create table student( id int primary key name text )`) } } class MyClass { print() { console.log(` create table student( id int primary key name text ) `) } } class MyClass { print() { console.log(``` create table student( id int primary key, name text ) ```) } }
function hello(name) { if (name === undefined) { throw new Error("arg: name must be passed"); } console.log(`Hello, ${name}`); } // throw expression function hello(name = throw new Error("arg: name must be passed")) { console.log(`Hello, ${name}`); } hello(); // Error 'arg: name must be passed' // throw statement const result = obj?.a?.b; if (result === undefined || result === null) { throw new Error("obj.a.b is undefined"); } // throw expression const result2 = obj?.a?.b ?? throw new Error("obj.a.b is undefined"); Initial commit: 2017/7/16 Latest commit: 2018/1/24 Champion: @rbuckton https://github.com/tc39/proposal-slice-notati on throw を式で書ける 関数のデフォルト値として定義したり ?. や ?? と組み合わせると便利 引数がなかったら throwする プロパティがなかったら throwする