ecmascript 6 - Is "type" a keyword in JavaScript? -
i came across using "type" in a piece of es6 code.
export type action =   {     type: 'todo/complete',     id: string,   } |   {     type: 'todo/create',     text: string,   } |   {     type: 'todo/destroy',     id: string,   } |   {     type: 'todo/destroy-completed',   } |   {     type: 'todo/toggle-complete-all',   } |   {     type: 'todo/undo-complete',     id: string,   } |   {     type: 'todo/update-text',     id: string,     text: string,   }; couldn't find sheds light on it. keyword? do?
as mentioned pitaj, type symbol here not part of es6, rather part of flow static type checker.
Comments
Post a Comment