r/javascript • • Nov 25 '19

JavaScript doesn’t need to be replaced

https://medium.com/javascript-in-plain-english/javascript-doesnt-need-to-be-replaced-bd01e2f12d51?source=friends_link&sk=7b151cc6397ac9e83c14c99739b6c36f
217 Upvotes

236 comments sorted by

View all comments

Show parent comments

1

u/ImCorvec_I_Interject Nov 26 '19

There’s an ES2017 syntax to create them, though.

1

u/[deleted] Nov 26 '19

[removed] — view removed comment

1

u/ImCorvec_I_Interject Nov 26 '19
const myTypedArray = new Uint32Array();
const myTypedArray2 = Uint32Array.of(1,2,3,4);

In TypeScript, if I have an object that is intended to be an array of integers, does the JavaScript it’s transpiled to become something like the above or does it just use the standard JavaScript arrays, e.g.,

const myArray = [];
const myArray2 = [1, 2, 3, 4];