TC39 proposal: Record and Tuples, the real immutable data structures in JavaScript.

const record = #{ prop: 1}; const tuple = #[1, 2, 3]
Records and tuples

One of the misleading use cases for beginners in JavaScript is to create constant arrays and objects. With the introductions of ES6, we got two new declarators: let, for mutable variables, and const, for constants. Many beginners believe that this will make their objects and array immutable, to discover later that they are not. The object or array…

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alberto de Murga

Alberto de Murga

119 Followers

Software engineer at @bookingcom . I write about tech, mostly *nix, git, JS & Go. https://threkk.com