Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 886 Bytes

File metadata and controls

51 lines (36 loc) · 886 Bytes

Records

Examples

Initialization

const a = new Record({ x: 1, y: 2 });

Initialization Sugar

const a = #{ x: 1, y: 2 };

Extension

const b = new Record(Object.assign({}, a, { z: 3 }));

Extension Sugar

const b = #{ ...a, z: 3 };

Type

typeof #[]; // 'record'

Syntax

RecordLiteral:

  • # { (... AssignmentExpression)? }
  • # { PropertyDataAssignment (, PropertyDataAssignment)* (, ... AssignmentExpression)? }

PropertyDataAssignment:

  • PropertyName : AssignmentExpression

Comparison Semantics

== and === test value equality.

<, >= etc. test value order/equality in enumeration order.

Notes

Enumeration always proceeds in lexicographic order of property names.

== and === test value equality < etc. test value order/equality