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…

--

--

--

Software engineer at Booking.com. I write about tech, mostly *nix, JS & Go. Also life stuff, learning languages and hobbies. https://threkk.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Randomness in React Props

How to write your own map, filter and reduce functions in JavaScript

How to make Async API calls in a loop

You Must Carefully Configure CORS on Your Backend and This Will Get You Started

How to implement the simplest search bar in React.js

State Management? Why it is a MUST have in SPAs

The Basics of Styling and Writing CSS in React

Comparing Data Structures: Arrays vs Objects

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

Software engineer at Booking.com. I write about tech, mostly *nix, JS & Go. Also life stuff, learning languages and hobbies. https://threkk.com

More from Medium

Different Types Of Constructor In C++

Getters And Setters: What Are Getters And Setters In JavaScript ?

Image of numbers on a dice

Operator Overloading in C++

Time zones and Flux — Part I